Problems setting Loglevel

Issue #474 resolved
Tim de Wit created an issue

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 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)

  1. Tim de Wit 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 level

    The 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.

  2. Ed McDonagh

    Thanks for going through this. I'm wondering how LOGGING['handlers']['file'] is supposed to relate to LOGGING['loggers']['remapp'] - should they not both be remapp?

  3. Ed McDonagh

    Although it seems to work - the files are created and populated! I must be missing something...

  4. Tim de Wit reporter

    They are linked in

        'remapp.netdicom.qrscu': {
            'handlers': ['qr_file'],
            'level': 'INFO',
            'propagate': False,
        'remapp': {
            'handlers': ['file'],
            'level': 'INFO',
  5. Ed McDonagh

    Sounds like we need to set the handler level to debug in I'll have a look at the instructions when I get a chance.

  6. Tim de Wit 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'
  7. Ed McDonagh

    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.

  8. Log in to comment