Oh, found my problem. The sqlalchemy log level was not set properly for me to get the SQLs. Thanks for your support.
On Thursday, February 27, 2020 at 1:39:00 PM UTC-5, doi zece wrote: > > Yes I want to see the SQLs hitting the DB. The initial issue I've > mentioned got resolved. What I'm trying now is to generate more logs, so > that it will be easier for me to investigate future similar issues. > > When you say "SQL logging will render all the SQL" you mean i have to > configure a new logger for this ? like [logger_sql] ? > With the configuration I've posted i only get this: > > [alembic.runtime.migration] 2020-02-27 18:32:26,177 INFO migration:154: > Context impl PostgresqlImpl. > [alembic.runtime.migration] 2020-02-27 18:32:26,177 INFO migration:154: > Context impl PostgresqlImpl. > [alembic.runtime.migration] 2020-02-27 18:32:26,179 INFO migration:161: > Will assume transactional DDL. > [alembic.runtime.migration] 2020-02-27 18:32:26,179 INFO migration:161: > Will assume transactional DDL. > [ldap3] 2020-02-27 18:32:26,315 INFO log:205: ldap3 library initialized - > logging emitted with loglevel set to DEBUG - available detail levels are: > OFF, ERROR, BASIC, PROTOCOL, NETWORK, EXTENDED - sensitive data will be > hidden > [alembic.runtime.migration] 2020-02-27 18:32:26,493 INFO migration:513: > Running upgrade 37e3e5e7e950 -> 23397de1f39e, test > [alembic.runtime.migration] 2020-02-27 18:32:26,493 INFO migration:513: > Running upgrade 37e3e5e7e950 -> 23397de1f39e, test > [alembic.runtime.migration] 2020-02-27 18:32:26,516 DEBUG migration:750: > update 37e3e5e7e950 to 23397de1f39e > [alembic.runtime.migration] 2020-02-27 18:32:26,516 DEBUG migration:750: > update 37e3e5e7e950 to 23397de1f39e > [root@mixvm server]# > > > for this upgrade script: > > def upgrade(): > # ### commands auto generated by Alembic - please adjust! ### > op.create_table('test', > sa.Column('id', sa.Integer(), nullable=False), > sa.Column('language', sa.String(length=7), > nullable=False), > sa.Column('created_at', postgresql.TIMESTAMP(), > autoincrement=False, nullable=True), > sa.PrimaryKeyConstraint('id') > ) > op.execute(""" > INSERT INTO test (language) VALUES ('en_us'); > """) > # ### end Alembic commands ### > > > I would like to see a log entry for the create table and one for the > insert. > > > On Thursday, February 27, 2020 at 1:20:27 PM UTC-5, Mike Bayer wrote: >> >> SQL logging will render all the SQL being emitted which should be enough >> to see everything the script is doing against the database. that is, if >> you ran op.alter_column(), you'd see "ALTER COLUMN..." in the log. not >> sure what else you are looking to see. >> >> do you think you're having a deadlock in Python and not against the >> database? there's no good way to debug that without using something like >> pdb or embedding print statements. that's a very unusual kind of issue in >> a tool like alembic and there are no known issues which could cause this. >> >> >> >> On Thu, Feb 27, 2020, at 1:12 PM, doi zece wrote: >> >> OK I managed to get some logging (it seems my alembic env.py was missing >> the fileConfig(config.config_file_name)). But still I'm not getting what i >> want. >> >> Basically i want a long entry for every single operation in the migration >> script. And this, if possible, without having to add log statements all >> over the place. Is that possible ? >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy-alembic" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sqlalchemy-alembic+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sqlalchemy-alembic/b0dc3a7e-cb00-456c-9e51-51dc56294380%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sqlalchemy-alembic/b0dc3a7e-cb00-456c-9e51-51dc56294380%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy-alembic/60f7f16c-0174-4764-9652-c2c96e4d4512%40googlegroups.com.