[systemd-devel] StandardOutput to file
Kay Sievers
kay at vrfy.org
Thu Mar 15 05:55:14 PDT 2012
2012/3/15 Martín Marqués <martin.marques at gmail.com>:
> Maybe my problem is that I'm new to systemd, but I can't make systemd
> do what I did with system V, particularly with PostgreSQL server.
>
> I the old system, I had the script make a redirection of the pg_ctl
> (postgresql script for starting, stopping, etc the server) output to a
> file, which would be the log file (default behaviour in Debian).
>
> The thing is that systemd doesn't let you send StandardOutput to a
> file. Best solution (which is how I'm doing it right now) is to send
> it to syslog and configure syslog accordingly. This is not the best
> solution, but it's the closest I found to what I wanted.
>
> The question would be: Is there some kind of work around, that doesn't
> involve using syslog, to log to a file? Are there plans on letting
> StandardOutput have a "file" option?
No, there are no plans to make systemd support individual files. All
logging goes to the journal which is a database. Tools can efficiently
extract the log stream of specific services from the journal, which
replaces that functionality.
If you want separate log files, syslog is probably the best solution
for it. If you want the logging of the future, you might want to look
in this direction:
https://github.com/intgr/pg_journal/blob/master/doc/pg_journal.md
Kay
More information about the systemd-devel
mailing list