Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
journalctl equivalent for openrc wanted
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Mgiese
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1628
Location: indiana

PostPosted: Wed Jun 26, 2024 10:40 am    Post subject: journalctl equivalent for openrc wanted Reply with quote

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 :D

Ryzen9 7950x (powersave governor) ; Geforce 3050 (70w) ; kernel 6.10.6 ; XFCE
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2437

PostPosted: Wed Jun 26, 2024 12:34 pm    Post subject: Re: journalctl equivalent for openrc wanted Reply with quote

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
View user's profile Send private message
RumpletonBongworth
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jun 2024
Posts: 82

PostPosted: Wed Jun 26, 2024 1:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum