GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — asyncio docs should call out that network logging is a no-no · Issue #65046 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
#97559
Closed
asyncio docs should call out that network logging is a no-no#65046
#97559
Copy link
Assignees
vstinner
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-asynciotype-featureA feature request or enhancementA feature request or enhancement

Description

@gvanrossum
gvanrossum
opened on Mar 3, 2014
Issue body actions
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

Next
  1. gvanrossum commented on Mar 3, 2014

    @gvanrossum
    gvanrossum
    on Mar 3, 2014
    MemberAuthor
    More actions

    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. gvanrossum
    assigned
    vstinner
    on Mar 3, 2014
  3. 1st1 commented on Mar 3, 2014

    @1st1
    1st1
    on Mar 3, 2014
    Member
    More actions

    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.

  4. gvanrossum commented on Mar 3, 2014

    @gvanrossum
    gvanrossum
    on Mar 3, 2014
    MemberAuthor
    More actions

    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. :-)

  5. 1st1 commented on Mar 3, 2014

    @1st1
    1st1
    on Mar 3, 2014
    Member
    More actions

    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.

  6. ezio-melotti
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    type-featureA feature request or enhancementA feature request or enhancement
    on May 9, 2014
  7. vstinner
    added
    topic-asyncio
    on Jun 6, 2014
  8. Mariatta commented on Oct 22, 2016

    @Mariatta
    Mariatta
    on Oct 22, 2016
    Member
    More actions

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

  9. vstinner commented on Oct 22, 2016

    @vstinner
    vstinner
    on Oct 22, 2016
    Member
    More actions

    +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().

  10. socketpair commented on Oct 25, 2016

    @socketpair
    socketpairmannequin
    on Oct 25, 2016
    Mannequin
    More actions

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

  11. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  12. serhiy-storchaka
    added this to Logging issues 🪵on May 20, 2022
  13. ezio-melotti
    added this to asyncioon Jun 20, 2022
  14. ezio-melotti
    moved this to Todo in asyncioon Jul 17, 2022
  15. 28 remaining items

  16. miss-islington
    added a commit that references this issue on Sep 28, 2022

    pythongh-65046: Add note about logging from async code. (pythonGH-97602)

    df6ecc0
  17. vsajip
    added 2 commits that reference this issue on Sep 28, 2022

    [3.10] gh-65046: Add note about logging from async code. (GH-97602) (G…

    feb4be1

    [3.11] gh-65046: Add note about logging from async code. (GH-97602) (G…

    73557d5
  18. gvanrossum
    added a commit that references this issue on Oct 12, 2022

    gh-65046: Link to logging cookbook from asyncio docs (#98207)

    c39a0c3
  19. miss-islington
    added 2 commits that reference this issue on Oct 12, 2022

    pythongh-65046: Link to logging cookbook from asyncio docs (pythonGH-…

    56e70c1

    pythongh-65046: Link to logging cookbook from asyncio docs (pythonGH-…

    81c73c2
  20. gvanrossum
    closed this as completedon Oct 12, 2022
  21. Repository owner moved this from In Progress to Done in asyncioon Oct 12, 2022
  22. miss-islington
    added 2 commits that reference this issue on Oct 12, 2022

    gh-65046: Link to logging cookbook from asyncio docs (GH-98207)

    bd73110

    gh-65046: Link to logging cookbook from asyncio docs (GH-98207)

    3165901
  23. carljm
    added 2 commits that reference this issue on Oct 14, 2022

    Merge branch 'main' into typewatch

    6e53514

    Merge branch 'main' into cached_property

    0bb0c69
  24. pablogsal
    added 3 commits that reference this issue on Oct 22, 2022

    gh-65046: Link to logging cookbook from asyncio docs (GH-98207)

    168ec08

    [3.11] gh-65046: Add note about logging from async code. (GH-97602) (G…

    8de3533

    GH-65046: Fix docs about logging in `asyncio` (GH-97559)

    e65e6de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @vstinner
    vstinner

Labels

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

Projects

  • asyncio
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.