neo000
Goto Top

Logging mit Docker und Journald

Hallo zusammen,

ich habe da mal eine bescheidene Frage. Und zwar möchte ich die Docker Logs mit Journald loggen. Allerdings ballert Docker dann den Log dermaßen voll mit Logs die ich aber nicht unbedingt brauche.

Wie kann ich denn das soweit filtern das er mir nur die Error Meldungen in den Log schreibt? Vllt hat das ja von euch schon mal jemand so umgesetzt, und kann mir mal einen Wink mit dem Zaunpfahl geben.

Schon mal vielen dank face-smile

Content-Key: 8889653342

Url: https://administrator.de/contentid/8889653342

Printed on: July 27, 2024 at 12:07 o'clock

Member: colinardo
colinardo Jan 25, 2024 updated at 07:27:10 (UTC)
Goto Top
Servus @Neo000.
Mit den Direktiven MaxLevelStore, MaxLevelSyslog der journald.conf kannst du festlegen welche Kategorien in den Logs landen:
MaxLevelStore=, MaxLevelSyslog=, MaxLevelKMsg=, MaxLevelConsole=, MaxLevelWall=

Controls the maximum log level of messages that are stored in the journal, forwarded to syslog, kmsg, the console or wall (if that is enabled, see above). As argument, takes one of "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug", or integer values in the range of 0–7 (corresponding to the same levels). Messages equal or below the log level specified are stored/forwarded, messages above are dropped. Defaults to "debug" for MaxLevelStore= and MaxLevelSyslog=, to ensure that the all messages are stored in the journal and forwarded to syslog. Defaults to "notice" for MaxLevelKMsg=, "info" for MaxLevelConsole=, and "emerg" for MaxLevelWall=. These settings may be overridden at boot time with the kernel command line options "systemd.journald.max_level_store=", "systemd.journald.max_level_syslog=", "systemd.journald.max_level_kmsg=", "systemd.journald.max_level_console=", "systemd.journald.max_level_wall=".

Grüße Uwe