module level loggers module level loggers most modules will not use the root logger to log informationinstead they will use named or module level logger such logger can be configured independently of the root logger this allows developers to turn on logging just for module rather than for whole application this can be useful if developer wishes to investigate an issue that is located within single module previous code examples in this have used the getlogger(function with no parameters to obtain logger objectfor examplelogger logging getlogger(this is really just another way of obtaining reference to the root logger which is used by the stand alone logging functions such as logging info()logging debug(functionthuslogging warning('my warning'and logger warning('my warninghave exactly the same effectthe only difference is that the first version involves less code howeverit is also possible to create named logger this is separate logger object that has its own name and can potentially have its own log levelhandlers and formatters etc to obtain named logger pass name string into the getlogger(methodlogger logging getlogger('my logger'this returns logger object with the name 'my loggernote that this may be brand new logger objecthowever if any other code within the current system has previously requested logger called 'my loggerthen that logger object will be returned to the current code thus multiple calls to getlogger(with the same name will always return reference to the same logger object it is common practice to use the name of the module as the name of the loggeras only one module with specific name should exist within any specific system the name of the module does not need to be hard coded as it can be obtained using the __name__ module attributeit is thus common to seelogger logging getlogger(__name__