sipcapture/homer-app

Database logs can't be switched off

Opened this issue · 8 comments

General logging settings does not affect the DB debug logs. GormLogger has no config settings and uncontrollably floods the logs to stderr without an option to redirect them to file or totally switch them off. It's ok for developing, but not for production.

Your report is appreciated. Please star this repository to motivate its developers! ⭐

Edit /usr/local/homer/etc/webapp_config.json and disable debug flag in database_data.

Edit /usr/local/homer/etc/webapp_config.json and disable debug flag in database_data.

Doesn't work. Show your fragment here, please.

Edit homer-app configuration

vim /usr/local/homer/etc/webapp_config.json

"database_data": {
"localnode": {
"help": "Settings for PGSQL Database (data)",
"host": "127.0.0.1",
"keepalive": true,
"name": "homer_data",
"node": "localnode",
"debug": false,
"pass": "**********",
"user": "homer_user"
}
},

restarthomer-app

systemctl restart homer-app

Doesn't work. Moreover, I tried to find it in the source code and have not found such option there.

Probably you use some specific version where it works?

Hi @andr-04
Can you provide us with more context and show what does not work ?
It's strange because it must work. We always tried the last available version.
Thanks

Of course, I restarted.

I still get output like this:

time="2023-07-13T15:00:29Z" level=info msg="SELECT * FROM \"hep_proto_100_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql
time="2023-07-13T15:00:29Z" level=info msg="SELECT * FROM \"hep_proto_5_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql
time="2023-07-13T15:00:29Z" level=info msg="SELECT * FROM \"hep_proto_35_default\"  WHERE (sid in ($1) and create_date between $2 and $3)" module=gorm type=sql
time="2023-07-13T15:00:31Z" level=info msg="SELECT * FROM \"hep_proto_1_call\"  WHERE (create_date between $1 and $2 AND id IN (862338)) LIMIT 200" module=gorm type=sql

Hi @andr-04 this is level=info I think that's the minimum one to have it. The debug=true is to have level=debug which is much more verbose.
I will confirm with you anyway if this is the correct behavior or not.