Why grafana logged info messages to /var/log/messages

We saw a lot of grafana-server log in /var/log/messages, this should log into grafana.log instead of /var/log/messages.

Mar 25 13:34:48 sps-me-us-oame-1 grafana-server[84532]: logger=context userId=0 orgId=0 uname= t=2024-03-25T13:34:48.197913127-04:00 level=info msg=“Request Completed” method=GET path=/api/live/ws status=401 remote_addr=10.139.40.14 time_ms=0 duration=4
69.851µs size=27 referer= handler=/api/live/ws
Mar 25 13:34:48 sps-me-us-oame-1 grafana-server[84532]: logger=context userId=0 orgId=0 uname= t=2024-03-25T13:34:48.40066506-04:00 level=info msg=“Request Completed” method=GET path=/api/live/ws status=401 remote_addr=10.139.40.14 time_ms=0 duration=47
0.422µs size=27 referer= handler=/api/live/ws
Mar 25 13:34:48 sps-me-us-oame-1 grafana-server[84532]: logger=context userId=0 orgId=0 uname= t=2024-03-25T13:34:48.572702103-04:00 level=info msg=“Request Completed” method=GET path=/api/live/ws status=401 remote_addr=10.139.40.14 time_ms=0 duration=4
49.2µs size=27 referer= handler=/api/live/ws

No, it depends how Grafana has logging configured. Eventually OS/service manager may have also own logging. So I would say that Grafana is logging to console (that’s default Grafana’s config) and OS/service manager redirects that to /var/log/messages.

Thanks,
in /etc/grafana.ini file, if I removed the mode from the console (leave file alone), it will not redirect to /var/log/messages, and it will only log to /var/log/grafana log files, am I right?

[log]

Either “console”, “file”, “syslog”. Default is console and file

Use space to separate multiple modes, e.g. “console file”

;mode = console file

Directory where grafana can store logs

logs = /var/log/grafana

I don’t know :man_shrugging:, because I don’t have your system/setup (and you didn’t provide anything useful: Grafana version, OS, service manager, …). The easiest solution is to try/test/improve it on your end directly.

Please format any codes/log/config snippets.