Discussion:
How to log to stdout AND logfile
(too old to reply)
SaAtomic
2017-07-03 12:50:16 UTC
Permalink
Raw Message
Hello,

I'm trying to find a way to have OpenVPN log to the stdout AND a logfile. I wouldn't want to use additional software such as `tee` for this.

With --log or --log-append, no stdout is printed. --syslog doesn't help here either.

I assume it would be possible with --daemon and a custom program, that prints to stdout and saves to a file.

Is there a way to have OpenVPN print to stdout and a log file?

Kind regards,
SaAtomic
David Sommerseth
2017-07-03 13:09:30 UTC
Permalink
Raw Message
Post by SaAtomic
Hello,
I'm trying to find a way to have OpenVPN log to the stdout AND a
logfile. I wouldn't want to use additional software such as `tee` for this.
With --log or --log-append, no stdout is printed. --syslog doesn't help here either.
I assume it would be possible with --daemon and a custom program, that
prints to stdout and saves to a file.
Is there a way to have OpenVPN print to stdout and a log file?
# openvpn --log /var/log/my-openvpn.log

and then:

# tail -f /var/log/my-openvpn.log


Except of that, no OpenVPN itself can only log to a single instance,
which can file, syslog or stdout. It is not possible to combine them in
the OpenVPN configuration file.
--
kind regards,

David Sommerseth
OpenVPN Technologies, Inc
David Sommerseth
2017-07-03 13:10:50 UTC
Permalink
Raw Message
Post by David Sommerseth
Post by SaAtomic
Hello,
I'm trying to find a way to have OpenVPN log to the stdout AND a
logfile. I wouldn't want to use additional software such as `tee` for this.
With --log or --log-append, no stdout is printed. --syslog doesn't help here either.
I assume it would be possible with --daemon and a custom program, that
prints to stdout and saves to a file.
Is there a way to have OpenVPN print to stdout and a log file?
# openvpn --log /var/log/my-openvpn.log
# tail -f /var/log/my-openvpn.log
Except of that, no OpenVPN itself can only log to a single instance,
which can file, syslog or stdout. It is not possible to combine them in
the OpenVPN configuration file.
Oh, and the systemd approach (I just had to):

# journalctl --since today -u openvpn-***@CONFIG_NAME -f
--
kind regards,

David Sommerseth
OpenVPN Technologies, Inc
Loading...