flaxsearch / flaxcode

Automatically exported from code.google.com/p/flaxcode
4 stars 1 forks source link

cherrypy logging output and rotatingfilehandler wart #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. generate lots of log output using the current default log configuration
(using the rotation options for the log file)

What is the expected output? What do you see instead?

The expectation is that once the log file is full it will be copied to a
backup file and new log message will start filling up the original file again. 

In fact the cherrypy generated log messages seem to go into the backup file.

Original issue reported on code.google.com by paul.x.r...@googlemail.com on 20 Nov 2007 at 4:47

GoogleCodeExporter commented 9 years ago
I think this is probably because more than one process is attempting to do the
rotation thing when the file gets full.

Original comment by paul.x.r...@googlemail.com on 20 Nov 2007 at 5:23

GoogleCodeExporter commented 9 years ago
We should probably do something for this for 1.0.

There are two obvious things to do without changing things too much. The first 
is to
ensure that different processes use different handlers. Given the current single
configuration file the easiest way to achieve this is probably to ensure that
different process use different loggers in the code and then configure those to 
use
different handlers in the config file.

Another approach would be to let all the logging be done by one process (a 
logging
server) and for child processes to send logging message back to the server for 
actual
logging. One problem with this is that to get it right you need to send every 
logging
event back to the server (or duplicate a lot of the logic of the logging 
module, or
partition the configuration file in a smart way) - even if current setting mean 
that
nothing will actually get logged. That could mean a context switch every log 
message
which sounds a bit nasty from a performance perspective.

So for 1.0 I'll do the first thing I think.

Original comment by paul.x.r...@googlemail.com on 21 Nov 2007 at 6:42

GoogleCodeExporter commented 9 years ago
The problem is fixed given the default configuration. It would still be 
possible to
reproduce with other configurations using e.g. a RotatingFileHandler.

The whole area of logging across different processes should maybe be looked at 
again
post 1.0, but since the immediate problem here is fixed I'll close this.

Original comment by paul.x.r...@googlemail.com on 22 Nov 2007 at 2:36