Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database logs can't be switched off #532

Open
andr-04 opened this issue Jul 13, 2023 · 8 comments
Open

Database logs can't be switched off #532

andr-04 opened this issue Jul 13, 2023 · 8 comments
Assignees

Comments

@andr-04
Copy link

andr-04 commented Jul 13, 2023

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
Copy link

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

@hrhashmi
Copy link

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

@andr-04
Copy link
Author

andr-04 commented Jul 13, 2023

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

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

@hrhashmi
Copy link

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
Copy link
Author

andr-04 commented Jul 13, 2023

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
Copy link

kYroL01 commented Jul 13, 2023

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
Copy link
Author

andr-04 commented Jul 13, 2023

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
Copy link

kYroL01 commented Jul 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants