logging and daemons
Fernando M. Maresca
fmaresca at gmail.com
Mon Feb 16 08:15:16 EST 2009
Hello, thanks for the answer.
On Mon, Feb 16, 2009 at 05:07:45AM -0800, Garrett Cooper wrote:
> You can actually set sys.std[err|out] to your ?file? descriptor of
> choice in python (it has to have read, write, and flush methods, IIRC
> to function). The only thing is (like all things dealing with multiple
> file descriptors like std[err|out]) the output may come in out of
> order due to flushing and insertion into the buffers, but it shouldn't
> be as much of an issue considering that the file descriptor for both
> items is the same descriptor, but this is just a note of forewarning.
Yes, but I'm trying to use *TimedRotating*FileHandler, which makes the
fd of the logfile change in every rotation of the logfile. So the direct
approach of std[out|err] redirection to the logfile fd obtained from
the logger instance is unusable (it works fine with a simple file
I'm looking into this because I really need rotating, because when
debugging is on, large amounts of data are logged, and because I like
the logging module approach in every aspect.
Also, may it be possible to derive the class and add a file-like write
method? Anyone using logging in this manner?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 204 bytes
Desc: Digital signature
More information about the Python-list