How can I specify a relative path in a Python logging config file?
- by ClaudioA
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.