logger configuration the output from this using the earlier yaml file is : : , [infomylogger starting : : , [debugmylogger do_somethingdebug message : : , [infomylogger do_somethinginfo message : : , [warningmylogger do_somethingwarn message : : , [errormylogger do_somethingerror message : : , [criticalmylogger do_somethingcritical message : : , [infomylogger done performance considerations performance when logging should always be consideration in general you should aim to avoid performing any unnecessary work when logging is disabled (or disabled for the level being usedthis may seem obvious but it can occur in several unexpected ways one example is string concatenation if message to be logged involves string concatenationthen that string concatenation will always be performed when log method is being invoked for examplelogger debug('countcount 'totaltotalthis will always result in the string being generated for count and total before the call is made to the debug functioneven if the debug level is not turned on however using format string will avoid this the formatting involved will only be performed if the string is to be used in log message you should therefore always use string formatting to populate log messages for erxmaplelogger debug(count%dtotal% 'count another potential optimisation is to use the logger isenabledfor (levelmethod as guard against running the log statement this can be useful in situations where an associated operation must be performed to support the logging operation and this operation is expensive for exampleif logger isenabledfor(logging debug)logger debug('message with % % 'expensive_func ()expensive_func ()