logger hierarchy the logger name hierarchy is analogous to the python package hierarchyand identical to it if you organise your loggers on per-module basis using the recommended construction logging getlogger(__name__this hierarchy is important when considering the log level if log level has not been set for the current logger then it will look to its parent to see if that logger has log level set if it does that will be the log level used this search back up the logger hierarchy will continue until either an explicit log level is found or the root logger is encountered which has default log level of warning this is useful as it is not necessary to explicitly set the log level for every logger object used in an application instead it is only necessary to set the root log level (or for module hierarchy an appropriate point in the module hierarchythis can then be overridden where specifically required formatters the are two levels at which you can format the messages loggedthese are within the log message passed to logging method (such as info(or warn()and via the top level configuration that indicates what additional information may be added to the individual log message formatting log messages the log message can have control characters that indicate what values should be placed within the messagefor examplelogger warning('% is set to % ''count' this indicates that the format string expects to be given string and number the parameters to be substituted into the format string follow the format string as comma separated list of values formatting log output the logging pipeline can be configured to incorporate standard information with each log message this can be done globally for all handlers it is also possible to programmatically set specific formatter on individual handlerthis is discussed in the next section to globally set the output format for log messages use the logging basicconfig(function using the named parameter format