override the settings on the parentachieving kind of level promotion here is an exampleimport logging the top-level logger 'applog logging getlogger('app'log setlevel(logging criticalonly accept critical level messages child logger 'app netnet_log logging getlogger('app net'net_log setlevel(logging erroraccept error messages on 'app netthese messages will now be handled by the 'applogger even though its level is critical when using hierarchical loggersyou only have to configure the logging objects where you want to change the filtering or propagation behavior because messages naturally propagate to the root loggerit will ultimately be responsible for producing the output and any configuration that you made using basicconfig(will apply message handling normallymessages are handled by the root logger howeverany logger object can have special handlers added to it that receive and process log messages this is done using these methods of logger instance log log addhandler(handleradds handler object to the logger log removehandler(handlerremoves the handler object handler from the logger the logging module has variety of pre-built handlers for writing log messages to filesstreamssystem logsand so forth these are described in further detail in the next section howeverthe following example shows how loggers and handlers are hooked together using these methods import logging import sys create top-level logger called 'appapp_log logging getlogger("app"app_log setlevel(logging infoapp_log propagate false add some message handlers to the 'applog app_log addhandler(logging filehandler('app log')app_log addhandler(logging streamhandler(sys stderr)issue some messages these go to app log and sys stderr app_log critical("creeping death detected!"app_log info("fyi"when you add your own handlers to process messagesit is often your intent to override the behavior of the root logger this is why message propagation is disabled in the previous example ( the 'applogger is simply going to handle all of the messagesf lib fl ff