systemd: how to set default log level for messages on stdout/stderr?

Viewed 4247

I am running an application as a systemd service. Application logs its output to stdout following systemd logging rules - prepending each log message with <x> where x is priority (log level).

<6> this is info
<7> this is debug
<4> this is warning

What I want is to store only priority <= 6 to journal because I run on flashdisk. I don't wan't to store debug messages and also messages/"trash" that is not marked with <>.

Seems not to be a problem - MaxLevelStore=info.

BUT - the problem is that that "trash" written to stdout is marked as priority=6 (info) by default and is also stored inside journal db. What I want is to mark it as debug (7) by default, so from following output:

<6> this is info
<7> this is debug
this is some trash
<4> this is warning

... will only ...

<6> this is info
<4> this is warning

... be stored to journal.

Can't find in all docs I have if/how is this possible. Anybody?

Thank you

1 Answers
Related