On Thu, Oct 21, 2021, at 12:08 PM, cmana...@gmail.com wrote:
> Hi,
> 
> Like the title says, I'm seeing some weird logging issues in production.  
> Using alembic and flask-migrate latest.  Works great locally (no issues) and 
> worked great on the server prior to a platform change.
> 
> I think I'm dealing with either a log level issue or I'm just logging into a 
> black hole.  I see stdout in the logs from prints and echos.  I can see when 
> exceptions are raised.  I can see prints inside the migration.  When I run 
> "from flask_migrate import current; current()" I see the revision ID as 
> output.  I just don't see the log output from an upgrade.  E.g. "A -> B".  
> Even though I know the migrations are running.
> 
> I've been looking at the alembic.ini.  I see logger_alembic has a blank 
> handler.  Is there a way to get it to point to stdout? Something like 
> handlers = stdout.  I'm not sure where its output is going currently.

the logging is set up in your own env.py.  this is the default:

https://github.com/sqlalchemy/alembic/blob/888fa838c824e9127eeb3d748c19df5da419748c/alembic/templates/generic/env.py#L14

that's directly where alembic calls the Python logging API.  so you can change 
that, or pdb in there and see if the logger works, etc.      so overall you 
likely have something up with the way in which the program is being run as 
relates to stdout etc.    try using a "File" logger to a specific log file and 
see if it writes messages, things like that.


> 
> I recently upgraded to the newest elastic beanstalk version.  With it came 
> some hook changes.  I mention them here just in case others have had this 
> issue.  Basically an ebextension became a postdeploy platform hook.
> 
> This is what my bash script looks like.
> 
>     "sudo docker exec $(sudo docker ps -q) flask managedb"
> 
> This is what the managedb flask command looks like.
> 
>     "from flask_migrate import upgrade; upgrade()"
> 
> Hopefully this isn't too out of scope for this group.  Any help is greatly 
> appreciated.
> 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/6b4422c9-67c2-4ae4-800b-95003012cdaan%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/6b4422c9-67c2-4ae4-800b-95003012cdaan%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/999a0967-34e0-4ed4-bc91-83f87181d329%40www.fastmail.com.

Reply via email to