Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alembic logs are not being captured in production #9

Open
obscurerichard opened this issue Dec 29, 2018 · 1 comment
Open

Alembic logs are not being captured in production #9

obscurerichard opened this issue Dec 29, 2018 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed infrastructure

Comments

@obscurerichard
Copy link
Member

The fix in PR #8 allowed the Alembic migrations to run even if it could not find the config file that ordinarily would let Alembic set up logging. However, this means that the alembic upgrade process is leaving no log entries in production, which is not ideal.

We should fix this one of these 3 ways:

  1. Even if Alembic can't find a config file with logging directives, it sets up logging with some reasonable defaults that match what's in the current alembic.ini file.
  2. Fix the way this gets invoked from freezing-web so that it knows where its config file should live
  3. Some other way to get logging going that I'm too ignorant to know about since I'm a SQLAlchemy newbie 😊
@obscurerichard obscurerichard added the bug Something isn't working label Dec 29, 2018
@obscurerichard obscurerichard changed the title Initialization of Alembic logs are not being captured in production Dec 29, 2018
@obscurerichard obscurerichard added the help wanted Extra attention is needed label Dec 29, 2018
@hozn
Copy link
Contributor

hozn commented Jan 6, 2019

I'm actually a bit unfamiliar with what alembic logs normally (when not using programmatic mode). I'm also a little surprised that we're not seeing anything, since we're constructing the Config object manually and this happens after we've already initialized logging. Maybe Alembic is logging at debug and they're just being suppressed?

Here's the relevant notes in docs: https://alembic.sqlalchemy.org/en/latest/api/config.html

See the section -- and particularly the warning -- under Config class for notes on programmatic instantiation of the Config objects. The docs aren't entirely clear to me:

Warning - When using programmatic configuration, make sure the env.py file in use is compatible 
with the target configuration; including that the call to Python logging.fileConfig() is omitted if the 
programmatic configuration doesn’t actually include logging directives.

There is logging indicating that the database is being upgraded. It may be that having individual logs about the specific revisions being migrated are not necessary / juice is not worth the squeeze ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed infrastructure
Projects
Status: Icebox
Development

No branches or pull requests

2 participants