How can I specify a relative path in a Python logging config file?
Posted
by ClaudioA
on Stack Overflow
See other posts from Stack Overflow
or by ClaudioA
Published on 2010-05-10T20:51:39Z
Indexed on
2010/05/10
20:54 UTC
Read the original article
Hit count: 241
I've the following file to config logging:
[loggers]
keys=root
[handlers]
keys = root
[formatters]
keys = generic
# Loggers
[logger_root]
level = DEBUG
handlers = root
# Handlers
[handler_root]
class = handlers.RotatingFileHandler
args = ("test.log", "maxBytes=1*1024*1024", "backupCount=10")
level = NOTSET
formatter = generic
# Formatters
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %Y-%m-%d %H:%M:%S
In Development this works great, but when I deploy the application test.log is trying to be written in a path in which I don't have the necessary permission.
So my question is, How can I do to specify a relative path in this configuration file.
© Stack Overflow or respective owner