Need help in configuration for TimedRotatingFileHandler
davea at ieee.org
Sun Aug 9 23:15:47 CEST 2009
> Need help in configure the TimedRotatingFileHandler from configuration
> I have tried with the below code and ended up with the error, code is
> pasted below
> Error - IOError: [Errno 2] No such file or directory: 'G:\\lok_sib\
> args=("G:\lok_sib\logs\rotate_test", 'midnight', 1)
> format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
> datefmt='%Y-%m-%d %H:%M:%S'
> Thanks or your time
I don't see code there, I see lots of config data, presumably in an .ini
file. So I don't know how you're reading it in, and converting it to
Python variables, but I know where I'd look, based on your error message.
The following line:
args=("G:\lok_sib\logs\rotate_test", 'midnight', 1)
seems to contain a Python string. But there are unescaped backslashes
within it. You can get away with it in two cases, because \l isn't a
valid escape sequence. But in the case of \r, it looks like a newline
Anyway, all three of those backslashes probably need to be doubled.
args=("G:\\lok_sib\\logs\\rotate_test", 'midnight', 1)
Two other cures that may work, depending on context: change the backslashes to forward slashes, or use a raw string.
But as I said earlier, you don't show in any way what code is interpreting this line, so it's all just guesswork.
More information about the Python-list