Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > protect logger from shutdown syslogd

Reply
Thread Tools

protect logger from shutdown syslogd

 
 
Mathias Kőrber
Guest
Posts: n/a
 
      02-25-2013
Hi

I have a script which calls getLogger to set up a logging service.
The standard logger description used both the consoleHandler and the
syslogHandler.

It seems that if syslogd is shut down, getLogger fails, and the script
won't be able to log at all.

is there a way to make it immune against this and automatically continue
the consoleHandler. Sure, we could amend the .ini file
to remove the syslogHandler from the logger definition when this is
known, but on a cron-initiated script this is not feasible.

below is the logger definition:

> [loggers]
> keys=root,mylogger
>
> [handlers]
> keys=consoleHandler,syslogHandler,rootHandler
>
> [formatters]
> keys=simpleFormatter,syslogFormatter,rootFormatter
>
> [logger_root]
> level=NOTSET
> handlers=rootHandler
>
> [logger_mylogger]
> level=INFO
> handlers=consoleHandler,syslogHandler
> #handlers=syslogHandler
> #handlers=consoleHandler
> qualname=mylogger
> propagate=0
>
> [handler_rootHandler]
> class=StreamHandler
> level=DEBUG
> formatter=rootFormatter
> args=(sys.stdout,)
>
> [handler_consoleHandler]
> class=StreamHandler
> level=DEBUG
> formatter=simpleFormatter
> args=(sys.stdout,)
>
> [handler_syslogHandler]
> class=handlers.SysLogHandler
> formatter=syslogFormatter
> level=INFO
> #args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
> args=('/dev/log', handlers.SysLogHandler.LOG_USER)



thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby's Logger vs ActiveRecord: no more Logger data output Georges Ko Ruby 4 07-26-2006 01:38 PM
why do i need to use org/apache/avalon/framework/logger/Logger to convert XSL-FO to PDF?? sachin XML 1 02-03-2006 09:58 PM
ruby's Logger conflict with Log4r's Logger cap Ruby 3 12-11-2005 03:44 PM
cisco logging to syslogd? Didier Cisco 13 01-25-2004 06:53 PM
Re: cisco logging to syslogd? Didier Cisco 12 01-16-2004 08:07 PM



Advertisments