Skip to content

Commit 3e64bee

Browse files
Don't disable existing loggers when Alembic runs (#65)
Python's documentation about this https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig. Alembic auto-generates this file, but I can't find other uses of it in Suffolk code (@nonprofittechy, I suggest you check LemmaLegal packages). Found by finding that when logs were broken on servers (the prod and sometimes dev servers), `docassemble.webapps.server.sys_log.disabled == True`. Consulted https://stackoverflow.com/a/43279730/11416267 once I discovered that. Tested and confirmed fixed locally on a localhost docassemble with the following (no good unit test : * restart docassemble's python code (by saving the config and restarting the server) * confirm the logs work by loading an interview with a unique log message, checking it's timestamp * run the `GithubFeedbackForm/feedback.yml` interview * on older versions, no more logs will be output after that * on this fixed version, you should be able to trigger and see new logs
1 parent f3d37d5 commit 3e64bee

File tree

1 file changed

+1
-1
lines changed
  • docassemble/GithubFeedbackForm/alembic

1 file changed

+1
-1
lines changed

docassemble/GithubFeedbackForm/alembic/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Interpret the config file for Python logging.
1818
# This line sets up loggers basically.
1919
if config.config_file_name is not None:
20-
fileConfig(config.config_file_name)
20+
fileConfig(config.config_file_name, disable_existing_loggers=False)
2121

2222
# add your model's MetaData object here
2323
# for 'autogenerate' support

0 commit comments

Comments
 (0)