0.3 upgrade now logs everything to my own logging file.

Issue #353 resolved
Former user created an issue

Just upgraded to 0.3 in Windows using pymssql.

I have a basic logging setup in my program to log my messages, but now 0.3 puts huge amounts of INFO statements in there too. I have not set any echo parameters or variables anywhere. I have not changed my program from SA 0.2.8 which did not log anything.

I can't find a way from the documentation to turn the logging off. From what I read it is supposed to be off by default. I must be missing somthing??

Comments (4)

  1. Mike Bayer repo owner

    you should give your application's log a name. if you set up a root logging configuration without giving a name, it will take effect for all loggers used in the application.

    to illustrate:

    from sqlalchemy import *
    import logging
    
    logging.basicConfig()
    logging.getLogger('somelog').setLevel(logging.INFO)
    
    mylog = logging.getLogger('somelog')
    
    mylog.info('start')
    
    e = create_engine('sqlite://')
    m = BoundMetaData(e)
    
    mylog.info('create table')
    
    t = Table('sometable', m, Column('col1', Integer, primary_key=True))
    m.create_all()
    
    mylog.info('done')
    

    if you take the name 'mylog' out of the getLogger() call, then all logging for SA is turned on and youll get that mess.

    ill add an FAQ entry for this.

  2. Mike Bayer repo owner

    I added an FAQ entry to the top of the FAQ for this one, and hopefully this is the issue you are seeing. reopen if otherwise.

  3. Mike Bayer repo owner
    • removed status
    • changed status to open

    it occurred to me that I also might add a setting of "ERROR" to the "sqlalchemy" log by default. let me decide if i want to do that.

  4. Log in to comment