Skip to content

Commit

Permalink
This ensures all logs are dumped to the same file / handler
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Jun 3, 2024
1 parent 6e152d3 commit 36b1595
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pyflask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def get(self):
)
log_handler.setFormatter(log_formatter)

flask_app.logger.addHandler(log_handler)
flask_app.logger.setLevel(DEBUG)
api.logger.addHandler(log_handler)
api.logger.setLevel(DEBUG)

flask_app.logger.info(f"Logging to {LOG_FILE_PATH}")
api.logger.info(f"Logging to {LOG_FILE_PATH}")

# Run the server
api.logger.info(f"Starting server on port {port}")
Expand Down

0 comments on commit 36b1595

Please sign in to comment.