View previous topic :: View next topic |
Author |
Message |
Mgiese Veteran
Joined: 23 Mar 2005 Posts: 1628 Location: indiana
|
Posted: Wed Jun 26, 2024 10:40 am Post subject: journalctl equivalent for openrc wanted |
|
|
Hi guys,
I want to monitor the output of the strongswan/ipsec vpn (or any other system) daemon. In systemd environments I can do that easily by
Code: | journalctl -b -u strongswan -f |
I did not find any non binary log file regarding strongswan in /var. I know I could look at /var/log/syslog but the output would simply be too much.
Any help is appreciated
Thanks _________________ I do not have a Superman complex, for I am God not Superman
Ryzen9 7950x (powersave governor) ; Geforce 3050 (70w) ; kernel 6.10.6 ; XFCE |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2418
|
Posted: Wed Jun 26, 2024 12:34 pm Post subject: Re: journalctl equivalent for openrc wanted |
|
|
Mgiese wrote: | I know I could look at /var/log/syslog but the output would simply be too much.
|
Grep and tail are your friends. I hated systemd for not allowing me to just grep for what I need instead providing me with --grep option which was a total garbage.
Best Regards,
Georgi |
|
Back to top |
|
|
RumpletonBongworth Tux's lil' helper
Joined: 17 Jun 2024 Posts: 77
|
Posted: Wed Jun 26, 2024 1:46 pm Post subject: |
|
|
You won't find anything quite like systemd-journald and journalctl elsewhere. You raise the concern that to write everything to "/var/log/syslog" would be too much, implying the presence of a service that has been configured to do so. A rational way to address this concern would be to simply refrain from doing that. For example, consider the following syslog-ng configuration.
Code: | @version: 4.6
@include "scl.conf"
options {
mark_freq(0);
stats(freq(0));
ts_format(iso);
};
source s_local {
system();
internal();
};
# Match messages not raised by daemons
filter f_general {
not filter(f_daemon);
};
# Match messages raised by daemons
filter f_daemon {
facility(daemon);
};
# Write to file incorporating the facility name
destination d_facility {
file("/var/log/${FACILITY}.log");
};
# Write to a daemon subdir, incorporating the program name
destination d_daemon {
file("/var/log/daemon/${PROGRAM}.log");
};
log {
source(s_local);
filter(f_general);
destination(d_facility);
};
log {
source(s_local);
filter(f_daemon);
destination(d_daemon);
}; |
There is plenty more that it can do, such as to write logs that incorporate date/time based components into the filename template. That way, logs would automatically 'rotate' themselves and one need not necessarily involve the use of the woefully inept logrotate utility. |
|
Back to top |
|
|
|