logging in python the format parameter takes string that can contain logrecord attributes organised as you see fit there is comprehensive list of logrecord attributes which can be referenced at html#logrecord-attributes the key ones areargs tuple listing the arguments used to call the associated function or method asctime indicates the time that the log message was created filename the name of the file containing the log statement module the module name (the name portion of the filenamefuncname the name of the function or method containing the log statement levelname the log level of the log statement message the log message itself as provided to the log method the effect of some of these are illustrated below import logging logging basicconfig(format='%(asctime) %(message) 'level=logging debuglogger logging getlogger(__name__def do_something()logger debug('this is to help with debugging'logger info('this is just for information'logger warning('this is warning!'logger error('this should be used with something unexpected'logger critical('something serious'do_something(the above program generates the following log statements : : , this is to help with debugging : : , this is just for information : : , this is warning : : , this should be used with something unexpected : : , something serious howeverit might be useful to know the log level associated with the log statementsas well as the function that the log statements were called from it is possible to obtain this information by changing the format string passed to the logging basicconfig(function