Skip to content

asyncio docs should call out that network logging is a no-no #65046

Description

@gvanrossum
BPO 20847
Nosy @vstinner, @merwok, @socketpair, @1st1, @Mariatta

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/vstinner'
closed_at = None
created_at = <Date 2014-03-03.20:12:20.295>
labels = ['type-feature', 'docs', 'expert-asyncio']
title = 'asyncio docs should call out that network logging is a no-no'
updated_at = <Date 2016-11-02.21:28:11.952>
user = 'https://github.com/gvanrossum'

bugs.python.org fields:

activity = <Date 2016-11-02.21:28:11.952>
actor = 'Mariatta'
assignee = 'vstinner'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'asyncio']
creation = <Date 2014-03-03.20:12:20.295>
creator = 'gvanrossum'
dependencies = []
files = []
hgrepos = []
issue_num = 20847
keywords = ['patch']
message_count = 7.0
messages = ['212664', '212666', '212671', '212689', '279181', '279184', '279371']
nosy_count = 6.0
nosy_names = ['vstinner', 'eric.araujo', 'socketpair', 'yselivanov', 'Winterflower', 'Mariatta']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue20847'
versions = ['Python 3.4']

Activity

  1. gvanrossum commented on Mar 3, 2014

    @gvanrossum
    MemberAuthor

    The asyncio package uses the logging module. We should remind users that they should always configure their logs to go to a file on the local filesystem -- using any kind of network logging will block the event loop.

  2. 1st1 commented on Mar 3, 2014

    @1st1
    Member

    Can we instead re-engineer asyncio logging to have logger calls in a separate thread?

    I.e. logger is a proxy object, that puts logging calls in a queue, and there would be another thread to block on the queue and do the actual logging. This way it won't really matter how logging is configured.

  3. gvanrossum commented on Mar 3, 2014

    @gvanrossum
    MemberAuthor

    If you really need network logging you should be able to configure a handler that puts things in a queue whose other end is serviced by an asyncio task. There should be no need to mess with the type of the logger object. Anyway, in 3.4 it is what it is. :-)

  4. 1st1 commented on Mar 3, 2014

    @1st1
    Member

    If you really need network logging you should be able to configure a handler that puts things in a queue whose other end is serviced by an asyncio task. There should be no need to mess with the type of the logger object.

    It's something that is easy to misconfigure. Having [logger+queue+logging thread] combination mitigates the risk a bit, but yeah, at the cost of increased complexity...

    Anyway, in 3.4 it is what it is. :-)

    Right.

  5. added
    docsDocumentation in the Doc dir
    type-featureA feature request or enhancement
    on May 9, 2014
  6. Mariatta commented on Oct 22, 2016

    @Mariatta
    Member

    Hi,
    I added to asyncio logging doc that the log file should point to a file on local filesystem.
    Please review. Thanks :)

  7. vstinner commented on Oct 22, 2016

    @vstinner
    Member

    +Logs for :mod:`asyncio` module should always point to a file on the local
    +filesystem. Using any kind of network logging will block the event loop.

    Well... even writing to a local file can block :-/

    By "network", what about the local UNIX socket used by syslog?

    I guess that the safest option would be a new asyncio library running
    all logs functions to a thread, or maybe using loop.run_in_executor().

  8. socketpair commented on Oct 25, 2016

    socketpairmannequin
    Mannequin

    Typical network logging is using syslog UDP. Sending UDP is never block.

  9. transferred this issue fromon Apr 10, 2022
  10. 28 remaining items

  11. added a commit that references this issue on Sep 28, 2022
  12. added 2 commits that reference this issue on Sep 28, 2022
  13. added a commit that references this issue on Oct 12, 2022
  14. added 2 commits that reference this issue on Oct 12, 2022
  15. Repository owner moved this from In Progress to Done in asyncioon Oct 12, 2022
  16. added 2 commits that reference this issue on Oct 12, 2022
  17. added 3 commits that reference this issue on Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dirtopic-asynciotype-featureA feature request or enhancement

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions