I
I
impressive172021-12-07 23:16:56
go
impressive17, 2021-12-07 23:16:56

How to use Promtail Grafana Loki in golang program?

I have a grafana cloud account. I want to set up integration with grafana loki, but I can't figure out how to do it.
I would like to write logs from the application to loki. Please tell me how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2021-12-07
@udjin123

The application itself is not required to send logs somewhere, and it is not necessary.
In general, as an example, I use the logrus package, the json log format, the output to stdout, the application in the container, respectively, the container logs in loki (I have it in the cluster, not the cloud) are sent by the docker plugin . When starting the container, it is indicated to use the loki driver for logging with the settings corresponding to where, format, etc. etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question