Turning off SQL Logging

55 views
Skip to first unread message

Abhishek Gupta

unread,
May 23, 2013, 12:16:20 AM5/23/13
to web...@googlegroups.com
Hi,

Is there an easy way to disable the logs generated in databases/sql.log other than editing gluon/dal.py?

Regards
Abhishek Gupta
Co-founder, Zumbl

Massimo Di Pierro

unread,
May 23, 2013, 9:43:45 AM5/23/13
to web...@googlegroups.com, abhi...@zumbl.com
No, but why?

Anthony

unread,
May 23, 2013, 9:55:18 AM5/23/13
to web...@googlegroups.com, abhi...@zumbl.com
I believe sql.log only records the SQL for migrations (i.e., table creation, altering tables, and truncating tables), so logging will be disabled if you disable migrations.

Anthony

Abhishek Gupta

unread,
May 23, 2013, 12:04:32 PM5/23/13
to Anthony, web...@googlegroups.com
Anthony, that souns good, thanks.
Massimo, our sql.log grows to almost 1GB each day. I used fake_migrate=True for all the tables.

Regards
Abhishek Gupta
Co-founder, Zumbl

Zumbl  |  Facebook  |  Twitter  |  LinkedIn

Anthony

unread,
May 23, 2013, 1:53:54 PM5/23/13
to web...@googlegroups.com, Anthony, abhi...@zumbl.com
Are you doing something that requires fake migrations every day (presumably multiple times per day)? Are the *.table files getting deleted?

Abhishek Gupta

unread,
May 23, 2013, 1:58:39 PM5/23/13
to Anthony, web...@googlegroups.com, sau...@zumbl.com, abhishe...@zumbl.com
No, we aren't doing anything that requires fake_migrations to be true. I did it because of the peculiar needs that we had :

Live Server - One domain - One database
Dev Server - Multiple domains/web2py installations - Shared database

Generally, when we make any change in db, I set migrate=True for that table which make changes to the shared database, and then, manually migrate the table using SQL syntax to the live server. But I think migrate=False should work equally well too, and I shouldn't thus be required to worry about the logging.

Regards
Abhishek Gupta
Co-founder, Zumbl

Zumbl  |  Facebook  |  Twitter  |  LinkedIn


Anthony

unread,
May 23, 2013, 2:12:26 PM5/23/13
to web...@googlegroups.com, Anthony, sau...@zumbl.com, abhishe...@zumbl.com, abhi...@zumbl.com
I was just wondering because I think writing to sql.log should only happen when there are actual changes to the table definitions (or if the *.table files are deleted or become corrupted). If you're not making any changes to the schema or touching the *.table files, I wouldn't think the sql.log file would fill up so quickly. What do you see in it?

Anthony

Abhishek Gupta

unread,
May 23, 2013, 2:14:42 PM5/23/13
to Anthony, web...@googlegroups.com, sau...@zumbl.com, abhishek.kumar
No, .table files aren't deleted or corrupted. Most of the output are of the type

timestamp: XXX
ALTER TABLE YYY DROP COLUMN ZZZ;
faked!

Regards
Abhishek Gupta
Co-founder, Zumbl

Zumbl  |  Facebook  |  Twitter  |  LinkedIn


Reply all
Reply to author
Forward
0 new messages