Message 69221

Author
JonLevy
Date
2021-08-06.14:06:26
Message id
69221

Content

I should have been more clear. I am talking about the logger in modules/__init__.py. What I experienced is that, when using a logging configuration file, I did not get the INFO log statements from this logger. Upon debugging, I found that logger.disabled == True, so it made no statements. I expect that you can easily reproduce this behavior by comparing the log statements you get from running a database update with a configuration file versus without. When passing a configuration file, you will see fewer log statements.

The reason this happens is that the default behavior of logging.config.fileConfig is to disabled any loggers that already exist before that function is called.[1] This can be corrected either by passing disable_existing_loggers=True, or by changing the order so that the logger is created after the fileConfig is applied.

[1]
https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig

History
Date User Action Args
2021-08-06 14:06:26JonLevysetmessageid: <1628251586.5785494.WAR65WYUEHWZNN3S.issue10637@tryton.org>
2021-08-06 14:06:26JonLevysetrecipients: + ced
2021-08-06 14:06:26JonLevylinkissue10637 messages
2021-08-06 14:06:26JonLevycreate

Showing 10 items. Show all history (warning: this could be VERY long)