F
F
Fluttercry2019-05-15 21:48:14
ubuntu
Fluttercry, 2019-05-15 21:48:14

How to redirect systemd service logs to a file?

Hello!
I needed to send the logs of several systemd services into one file
tried to do this

StandardOutput=append:/var/log/current.log
StandardError=append:/var/log/current.log

according to https://www.freedesktop.org/software/systemd/man/s...
append:path is similar to file:path above, but it opens the file in append mode.

But time after time I get
Failed to parse output specifier, ignoring: append:/var/log/current.log

All folders on the path are exactly there.
Do not tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2019-05-15
@sim3x

Try to create two streams in your PL (or run two scripts at the same time) and write from them to one file
Write to different files, and when analyzing combine them, sort by the datetime field

P
pfg21, 2019-05-16
@pfg21

can it is necessary to work from the return - all to pour in the general broad gull. and already then to filter on the necessary services??
$ journalctl -t %service1% -t %service2%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question