> -----Original Message-----
> From: Miroslav Lichvar [mailto:mlich...@redhat.com]
> Sent: Monday, October 23, 2017 12:58 AM
> To: Richard Cochran <richardcoch...@gmail.com>
> Cc: linuxptp-devel@lists.sourceforge.net
> Subject: Re: [Linuxptp-devel] [PATCHv2 0/3] Add logging to file
> 
> On Fri, Oct 20, 2017 at 02:17:41PM -0700, Richard Cochran wrote:
> > On Fri, Oct 20, 2017 at 01:51:09PM +0200, Miroslav Lichvar wrote:
> > > These patches add support for logging to a specified file, in addition
> > > to the standard output and system log. This is useful when ptp4l or
> > > phc2sys is started in such a way which doesn't allow the standard
> > > output to be redirected to a separate file (e.g. systemd).
> >
> > Is this really needed?
> >
> > I thought that one of the selling points for systemd is how
> > configurable the logging is. I am pretty sure you can have journald
> > log to a separate files.
> 
> How? It seems journald uses its own specific format for logs and all
> services (per user) are mixed together. Systemd unit can be configured
> to log to the journal, syslog and few other options, but I don't see a
> way how to make a separate log per service, except by wrapping the
> ptp4l/phc2sys commands in shell.
> 
> The best option I found is to change the syslog identifier or syslog
> facility and configure some filters in rsyslog.
> 

Journald comes with its ouwn methods of filtering, for example, if you are 
running phc2sys using a systemd service called phc2sys.service, you can do:

journalctl -u phc2sys

and it will show only output from that service.

Yes, if you just run journalctl on its own it will mix everything together, but 
it comes with extensive filtering abilities in journalctl to find exactly what 
you want.

That doesn't mean there isn't value in adding the ability to log output to 
separate files if you want, but I don't think systemd itself provides 
justification for that need.

Thanks,
Jake

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to