logger configuration the logging configuration file can be written using several standard formats from json (the java script object notation)to yaml (yet another markup languageformator as set of key-value pairs in conf file for further information on the different options available see the python logging module documentation in this book we will briefly explore the yaml file format used to configure loggers version formattersmyformatterformat'%(asctime) [%(levelname) %(name) %(funcname) %(message)shandlersconsoleclasslogging streamhandler leveldebug formattermyformatter streamext://sys stdout loggersmyloggerleveldebug handlers[consolepropagateno rootlevelerror handlers[consolethe above yaml code is stored in file called logging conf yamlhowever you can call this file anything that is meaningful the yaml file always starts with version number this is an integer value representing the yaml schema version (currently this can only be the value all other keys in the file are optionalthey includeformatters--this lists one or more formatterseach formatter has name which acts as key and then format value which is string defining the format of log message filters--this is lit of filter names and set of filter definitions handlers--this is list of named handlers each handler definition is made up of set of key value pairs where the keys define the class used for the filter (mandatory)the log level of the filter (optional)the formatter to use with the handler (optionaland list of filters to apply (optionalloggers--provides one or more named loggers each logger can indicate the log level (optionaland list of handlers (optionalthe propagate option can be used to stop messages propagating to parent logger (by setting it to falseroot--this is the configuration for the root logger