Example of how to use logging for both screen and file

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Oct 27 06:36:26 EDT 2004


> Could someone help me figure out what is wrong here
> ?? I'd like to use
> logging to send logs to syslogd as well as a file.
> The file logging
> seems to be fine, but why don't I see anything in
> '/var/log/messages'
[snip]
>    flog.setLevel(logging.INFO)
>    slog.setLevel(logging.INFO)
[snip]
> flog.info("##################### foo
> #####################")
> slog.debug("################## bar
> ####################"")

You've set up slog to only pass messages of INFO or
higher, but you're logging a DEBUG message - lower
than INFO, so it doesn't get logged.

Regards,


Vinay Sajip


	
	
		
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun!  http://uk.messenger.yahoo.com



More information about the Python-list mailing list