Please tell me where to find the own log files from loki itself

Hello there,

my wish is to create a dashboard on Graphana which is showing me Lokis own (Server-?)log, not the logs which are brought by the tenant, I mean the logs which focus on the actual work of the program Loki.

I cant find the path to the default Loki-Log-file. Where is it?

I installed it locally on Debian

whereis loki
loki: /usr/bin/loki /etc/loki

I am so confused!

1 Like

I’ve not tried running Loki as a binary installation, so I can’t tell you for sure. But perhaps check journal?

1 Like

Good Day tonyswumac,

With

sudo journalctl -f -u loki

we are able to see the log-entries of the activity of Grafana Loki.

But from this point I am not smart enough to get the path to the log-file which I will need to give promtail to scrape it from.

I think that those are not all log entries Loki might produce? Maybe the components of Loki write some logs too?

The Log-File of Loki could be volatile?

Maybe there is another solution next to giving promtail a path to a log file?

Thank you for your attention!

DieAllNetFlat

Promtail can be configured to pick up logs from journal, see Configuration | Grafana Loki documentation. Most of the log agents should support this.

Loki logs onto to stderr: loki/log.go at main · grafana/loki · GitHub

That is to say: it is not logged to a file at all but rather just the process’ stderr output stream. The journal picks up these logs, and as @tonyswumac points out you can have promtail scrape the journal.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.