develooper Front page | perl.beginners | Postings from May 2020

Re: Where do messages sent with syslog go when there is only ajournal?

Thread Previous | Thread Next
From:
hw
Date:
May 28, 2020 13:13
Subject:
Re: Where do messages sent with syslog go when there is only ajournal?
Message ID:
7798860.NyiUUSuA9g@toy.adminart.net
On Tuesday, May 19, 2020 6:37:41 PM CEST Andy Bach wrote:
> Huh, news to me:
> https://www.loggly.com/ultimate-guide/using-journalctl/
> 
> cpan shows at least 5 modules for handling journald stuff, Log::Journald
> shows
> use Log::Journald;
> use Sys::Syslog qw/:macros/;
> 
> # Easy.
> journal_log(LOG_INFO, "Hello (1) from PID $$!");
> 
> # Send arbitrary fields, even binary data
> Log::Journald::send(PRIORITY => LOG_INFO,
>      MESSAGE => "Hello (2) from PID $$!",
>      PERL_PACKAGE => __PACKAGE__,
>      _YOLO => "SW\x00AG")
>      or warn "Could not send log: $!";
> 
> # Raw
> Log::Journald::sendv('PRIORITY=6',
>      "MESSAGE=Hello (3) from PID $$!");
> 

Well ... I was looking at search results from dnf in Fedora 32 ...  I rather 
use packages from package management because otherwise, you need to keep track 
of updates yourself.  After a while, you have so much unincluded software on 
so many different machines that you loose track of things.

And what do you do when you need your program to be able to run on different 
distributions some of which use syslog, some of which have only a journal and 
some of which have both?

(The journal is a retarded idea and I hate it and never use it.  That doesn't 
mean I don't want the logging to go wrong.)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About