sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
200 stars 77 forks source link

Database logs can't be switched off #532

Open andr-04 opened 1 year ago

andr-04 commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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

hrhashmi commented 1 year ago

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

andr-04 commented 1 year ago

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

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

hrhashmi commented 1 year ago

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
andr-04 commented 1 year ago

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?

kYroL01 commented 1 year ago

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

andr-04 commented 1 year ago

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
kYroL01 commented 12 months ago

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.