Alembic disables my logs

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
Search for a command to run...

I am developer/code-reviewer/debugger/bug-fixer/architect/teacher/builder from dubai, uae
No comments yet. Be the first to comment.
You Should Tell Yourself

A URL shortener is a proxy service that provides a mapping between the short and full representation of a URL. The short URL has the advantage of being small. The service can also provide useful analy

Listening to the Mel Robbins's podcast on regrets was a 'ear'-opener. One can have reqrets of action or inaction. 4 types of reqrets foundation - should've done the work boldness - should've taken t

We need to create a unique ID generator for our high-traffic web application, generating about 10K IDs/second. The IDs can't simply be monotonically increasing integers, which are good for data access
doing + telling

…and how to get them back
Alembic is SQLAlchemy's database migration framework—think change management for your relational database. It autogenerates scripts tracking your ORM model changes, letting you recreate your data model at any point in time.
Most apps run migrations on startup. I noticed my logs would mysteriously vanish right after the migration check.
The culprit? This innocent-looking snippet in the auto-generated env.py:
if config.config_file_name is not None:
fileConfig(config.config_file_name)
That fileConfig defaults to disable_existing_loggers=True (thanks, backwards compatibility!), nuking any logging you previously configured.
The fix: Either edit the generated env.py or configure your logging after migrations run.
Happy hackin'