omnilib / aiosqlite

asyncio bridge to the standard sqlite3 module

Home Page:https://aiosqlite.omnilib.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't log result in DEBUG, or truncate if too large

pawamoy opened this issue · comments

Description

Logging the result of the run method can be problematic when the result is big.
If you query a whole table, the log line can quickly be really, really heavy!! Like in the 100MB range 😮

LOG.debug("returning %s", result)

We are currently facing downtime on a webservice using this library indirectly and setting the log level to DEBUG.

I suggest to stop logging the result in DEBUG level (or any other level), or at least truncate it when it's too big.
"Too big" needs to be defined though. Or maybe always truncate to... 100 or 1K characters?

Details

  • OS: RedHat
  • Python version: 3.6.12
  • aiosqlite version: 0.16.0
  • Can you repro on 'main' branch? line is still in HEAD, so most probably
  • Can you repro in a clean virtualenv? not relevant?

Alternative solutions:

  • configuring logging to ignore logs coming from aiosqlite
  • setting log level to INFO, though until the application/service is stable, DEBUG is needed 😕

Nice, thank you very much @jreese 🙂