sni / lmd

Livestatus Multitool Daemon - Create livestatus federation from multiple sources
https://labs.consol.de/omd/packages/lmd/
GNU General Public License v3.0
42 stars 31 forks source link

introduce logfile "stdout-journal" #136

Closed klaernie closed 1 year ago

klaernie commented 1 year ago

This is a very naive attempt at making the log output configurable to not output colors, and skip the date/time, since these would be provided by journald anyway.

I'm pretty sure that this is not the optimal way to implement it, but I wanted to run this in production (I'm currently setting up a local lmd on each of our worker processes, to replace the xinetd-alike unixcat approach of accessing the livestatus unix socket via tcp/ip). In our production environment we use filebeat to transport the journal to a central instance, and I wanted to avoid having to strip ansi-escape-sequences in filebeat.

The better approach probably needs more config options to enable/disable datetime logging and colors separately from each other, or autodetects if the output goes to a terminal to enable colors (test -t 1). Once might also argue that native journald logging would be better, but also that's way beyond my golang skills.

klaernie commented 1 year ago

Forgot to mention: I wouldn't be offended at all if you'd deem this PR as non-mergeable, I'm very well aware that this change might not fit the overall structure or style.

sni commented 1 year ago

looks ok to me, maybe you could mention the various logfile options in the ini example file?

klaernie commented 1 year ago

Oh, right, totally forgot that I wanted to do that. Lemme do that!

klaernie commented 1 year ago

sorry for the force push - just noticed that I typoed in the documentation

sni commented 1 year ago

no worries, haven't merged it yet :-)

sni commented 1 year ago

thanks