powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
768 stars 57 forks source link

How to run in quiet mode while behind httpd #125

Closed edechaux closed 2 years ago

edechaux commented 4 years ago

Hello, In PoWA documentation there is a sample configuration to run it behind an httpd server.

When using the standalone version, it is possible to use the --logging=warning to disable access logs being printed on the console. I can't find a way to do so with mod_wsgi and the default httpd errorlog get filled with unwanted data like :

[Wed Mar 25 15:56:39 2020] [error] [pid 23494] mod_wsgi.c(1631): [client [I 200325 15:56:39 web:1907] 200 GET /metrics/wait_event_by_databases/?from=2020-03-25+14%3A56%3A39%2B0100&to=2020-03-25+15%3A56%3A39%2B0100 (128.96.81.85) 40.10ms

What can I do ?

Thanks

rjuju commented 4 years ago

Sorry I'm not really familiar with mod_wsgi. I think that what you can do is modify powa.wsgi, and add (probably anywhere would be ok as long as it's reached)

tornado.log.access_log.setLevel(logging.WARNING)
edechaux commented 4 years ago

Yes it works but require to import logging for logging.WARNING definition.

rjuju commented 4 years ago

On Wed, Mar 25, 2020 at 4:56 PM edechaux notifications@github.com wrote:

You gave me the missing link. In /etc/powa-web.conf I added the following line:

logging=logging.WARN

After httpd restart no more logs. This is however not compatible with the standalone version.

Oh right, this is an option setup by tornado so it's actually configurable there! I'll add some documentation about it, probably other users will be glad to know that.

rjuju commented 4 years ago

On Wed, Mar 25, 2020 at 5:11 PM edechaux notifications@github.com wrote:

Yes it works but require to import logging for logging.WARNING definition.

Ah indeed, I missed that (I was testing using another script since I don't have an httpd server setup right now).