Runtime change of logging config...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Runtime change of logging config...

venkatbo-2

Hi,

For example, assume there is config like this:

--------------
...
[logging]
[[formatters]]
[[[message_only]]]
format='*(message)s'
...

[[handlers]]
...
[[[access_out]]]
class='StreamHandler'
level='INFO'
## args='(sys.stdout,)'
formatter='message_only'

[[[error_out]]]
class='StreamHandler'
level='ERROR'
## args='(sys.stdout,)'
....
--------------

Rather than specifying the info for "args" here, I'd like to
specify it in the application during init (priot to setting up
the logger etc). In this hierarchical config scenario:
    [logging]  -->  [[handlers]]  --> [[[access_out]]] --> ...
and
    [logging]  -->  [[handlers]]  --> [[[error_out]]] --> ...
how can one use onfig.update() to "update" the "args"
config at runtime - ensuring there is no namespace
collision between both the cases.

Thanks,
/venkat


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-devel" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-devel
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Runtime change of logging config...

venkatbo-2

Oops.. sorry meant to post in the users' grp.
/venkat


On Sep 21, 11:57 am, venkatbo <[hidden email]> wrote:

> Hi,
>
> For example, assume there is config like this:
>
> --------------
> ...
> [logging]
> [[formatters]]
> [[[message_only]]]
> format='*(message)s'
> ...
>
> [[handlers]]
> ...
> [[[access_out]]]
> class='StreamHandler'
> level='INFO'
> ## args='(sys.stdout,)'
> formatter='message_only'
>
> [[[error_out]]]
> class='StreamHandler'
> level='ERROR'
> ## args='(sys.stdout,)'
> ....
> --------------
>
> Rather than specifying the info for "args" here, I'd like to
> specify it in the application during init (priot to setting up
> the logger etc). In this hierarchical config scenario:
>     [logging]  -->  [[handlers]]  --> [[[access_out]]] --> ...
> and
>     [logging]  -->  [[handlers]]  --> [[[error_out]]] --> ...
> how can one use onfig.update() to "update" the "args"
> config at runtime - ensuring there is no namespace
> collision between both the cases.
>
> Thanks,
> /venkat


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-devel" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-devel
-~----------~----~----~----~------~----~------~--~---