operating system services most of these parameters are self-explanatory the format argument is used to specify the format of log messages along with optional contextual information such as filenameslevelsline numbersand so forth datefmt is date format string compatible with the time strftime(function if omittedthe date format is set to the iso format the following expansions are recognized in formatformat description %(name) %(levelno) %(levelname) %(pathname) %(filename) %(funcname) %(module) %(lineno) %(created) name of the logger numeric logging level text name of the logging level pathname of the source file where the logging call was executed filename of the source file where the logging call was executed function name in which the logging call was made module name where the logging call executed line number where the logging call executed time when the logging call executed the value is number as returned by time time(ascii-formatted date and time when the logging call was executed millisecond portion of the time when the logging call executed thread id thread name process id the logged message (supplied by user%(asctime) %(msecs) %(thread) %(threadname) %(process) %(message) here is an example that illustrates single configuration where log messages with level of info or higher are appended to fileimport logging logging basicconfigfilename "app log"format "%(levelname)- %(asctime) %(message)slevel logging info with this configurationa critical log message of 'hello worldwill appear as follows in the log file 'app logcritical : : , hello world logger objects in order to issue log messagesyou have to obtain logger object this section describes the process of creatingconfiguringand using these objects creating logger to create new logger objectyou use the following functiongetlogger([logname]returns logger instance associated with the name logname if no such object existsa new logger instance is created and returned logname is string that specifies name lib fl ff