Prometheus Log Format

28 views
Skip to first unread message

mostafa hamdy

unread,
Aug 30, 2020, 11:18:08 AM8/30/20
to Prometheus Users
Hi team,
Currently i am using prometheus docker image prom/prometheus.
I wanted to send prometheus logs to kibana, instead of having to ssh to the machines and find find the logs.
Is it possible to change the log format for prometheus, and if it's possible then how can i do it?

Also where is the log directory inside docker?
Currently to find logs i have two ways:
  1. docker logs {containerId}.
  2. In host machine inside /var/lib/docker/containers/*/*.log.
Where can i find log directory inside docker so i can map it to a directory in host machine outside docker.

Ben Kochie

unread,
Aug 30, 2020, 11:21:42 AM8/30/20
to mostafa hamdy, Prometheus Users
Prometheus only logs to stderr. The log format is controlled by the `--log.format` flag. The only option is the default logfmt format, and json.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/695f176c-e918-47f2-b8fc-2def5aa57225n%40googlegroups.com.

mostafa hamdy

unread,
Aug 30, 2020, 11:28:12 AM8/30/20
to Ben Kochie, Prometheus Users
If i use json format, can i modify the attributes name? does it have something similar to log4j.xml that i can override it and define new attributes?

Ben Kochie

unread,
Aug 30, 2020, 11:33:03 AM8/30/20
to mostafa hamdy, Prometheus Users
No, there are no options.
Reply all
Reply to author
Forward
0 new messages