[Answer]-Django log messages not processing correctly. Messages to multiple files

1👍

You have two different loggers, named '' (the root logger) and 'auth'. The order in which your two statements appear:

logger = logging.getLogger('')
logger = logging.getLogger('auth')

obviously makes a difference when you call

logger.info(...)

as in the two cases you will be calling the method on two different loggers. You might wish to change your code to

root_logger = logging.getLogger('')
logger = logging.getLogger('auth')

and then call methods on either root_logger or logger as appropriate.

Leave a comment