FAQ
Hy guys,

this PEP is very well written, and I have found the discussion inspiring.

Every time I use the logging module, I have the configuration hardcoded in
the application. That is why I never used the configuration file based
approach. Now I will give it a try.....

I think we should discuss the following scenario (it was not clear in the
PEP for me) : an application has the logging configuration in a config file
and it is currently running. The user edits this file, so the configuiration
in the running process should be changed.
-- How will be the logging mechanism reconfigured?
-- How can the logging module guarantee that there will be no data loss
during the reconfiguration process?


Regards,
Gabor


--
Linux: Choice of a GNU Generation

Search Discussions

  • Vinay Sajip at Oct 28, 2009 at 2:11 pm

    Gabor Urban <urbangabo <at> gmail.com> writes:

    this PEP is very well written, and I have found the discussion inspiring.

    Every time I use the logging module, I have the configuration hardcoded in
    the application. That is why I never used the configuration file based
    approach. Now I will give it a try.....
    Are you talking about PEP 337 (Logging Usage in the Standard Library) or PEP 391
    (Dictionary-Based Configuration For Logging) ? Based on the body of your post
    (rather than the title) you would appear to be talking about 391 rather than 337.

    PEP 337 is about changing the stdlib to make more use of logging internally.

    PEP 391 is about a new configuration approach for logging, using dicts.

    Regards,

    Vinay Sajip
  • Vinay Sajip at Oct 28, 2009 at 10:16 pm
    Gabor Urban <urbangabo <at> gmail.com> writes:
    Hy guys,

    this PEP is very well written, and I have found the discussion inspiring.

    Every time I use the logging module, I have the configuration hardcoded in
    the application. That is why I never used the configuration file based
    approach. Now I will give it a try.....

    I think we should discuss the following scenario (it was not clear in the
    PEP for me) : an application has the logging configuration in a config file
    and it is currently running. The user edits this file, so the configuiration
    in the running process should be changed.
    You would have to do this "by hand": watch for file changes, reload the file
    into a dict, call logging.config.dictConfig with the new dict.

    PEP 391 is basically about using a dict to configure logging, but doesn't say
    where the dict comes from - it could be from deserializing a YAML or JSON file
    or importing a Python source file, or it could be received as a pickle over the
    wire and unpickled ... the logging package only knows about the dict and this
    must follow the schema described in the PEP.

    Regards,

    Vinay Sajip

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 28, '09 at 12:45p
activeOct 28, '09 at 10:16p
posts3
users2
websitepython.org

2 users in discussion

Vinay Sajip: 2 posts Gabor Urban: 1 post

People

Translate

site design / logo © 2022 Grokbase