-
-
Save EdwardIII/0d423cdb2a047f6e7855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api = MyApi() | |
fileh = logging.FileHandler('/tmp/myapp.log', 'a') | |
fileh.setLevel(logging.INFO) | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
fileh.setFormatter(fileh) | |
api.logger.addHandler(fileh) | |
api.do_something_that_contains_a_logging_call() # myapp.log gets created, but is empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment