- edited description
Problems setting Loglevel
I'm using the proposed LOGGING settings from local_settings.example, but setting the LOGGING['loggers']['remapp.netdicom.qrscu']['level'] to 'DEBUG' (or any of the other loggers) doesn't seem to work (in my case for qrscu.py in combination with openrem_qr.log).
What does seem to work is adding e.g. a line like this: LOGGING['handlers']['qr_file']['level'] = 'DEBUG'
However, all LOGGING['loggers'] lines seem to be ignored. Changing levels or even commenting them out doesn't do anything.
Comments (12)
-
reporter -
reporter Correction, its seems like the following: handler-level = INFO (20), logger-level = DEBUG (10) --> logging at INFO level
handler-level = DEBUG, logger-level = INFO --> logging at INFO level
handler-level = DEBUG, logger-level = DEBUG --> logging at DEBUG levelThe handler-level is not set in the current situation, and keeps its default value of WARNING (30); therefore you'll never get DEBUG messages.
The effective log level seems to be determined by the logger-level, with a minimum level determined by the handler-level. -
Thanks for going through this. I'm wondering how
LOGGING['handlers']['file']
is supposed to relate toLOGGING['loggers']['remapp']
- should they not both beremapp
? -
Although it seems to work - the files are created and populated! I must be missing something...
-
reporter They are linked in settings.py::
'remapp.netdicom.qrscu': { 'handlers': ['qr_file'], 'level': 'INFO', 'propagate': False, }, 'remapp': { 'handlers': ['file'], 'level': 'INFO', },
-
Sounds like we need to set the handler level to debug in settings.py. I'll have a look at the instructions when I get a chance.
-
reporter I guess you only have to change the current settings from INFO to DEBUG:
'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, 'file': { 'level': 'INFO', 'class': 'logging.FileHandler', 'filename': 'openrem.log', 'formatter': 'verbose' }, 'qr_file': { 'level': 'INFO', 'class': 'logging.FileHandler', 'filename': 'openrem_qrscu.log', 'formatter': 'verbose' }, 'store_file': { 'level': 'INFO', 'class': 'logging.FileHandler', 'filename': 'openrem_storescp.log', 'formatter': 'verbose' }, },
-
I've read the docs, and I agree. If the handler is set to debug, then it will 'handle' anything that is passed to it. Then the user can set the logging level to what they like and it will be honoured.
-
Changing the handler level to DEBUG so that everything is handled. Logger level in local_settings will determine what logs are generated. Refs
#474→ <<cset 252b79e42c17>>
-
Added note to troubleshooting regarding log level. Added to changes/CHANGES. Refs
#474→ <<cset 1fffc7f4102e>>
-
- changed status to resolved
Changed log level that will be handled so any log level set in local_settings will work. Fixes
#474→ <<cset 4f6f0d27cbb8>>
-
-
assigned issue to
- changed milestone to 0.8.0
-
assigned issue to
- Log in to comment