How to use logging with python’s fileConfig and configure the logfile filename

Change your handler_fileHandler section like so:

[handler_fileHandler]
class=FileHandler
level=DEBUG
formatter=fileFormatter
args=('%(logfilename)s',)

and then add a defaults argument to the fileConfig call

logging.config.fileConfig(loginipath, defaults={'logfilename': '/var/log/mylog.log'})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)