Directing log outputs of several units to a specific file

This forum is for discussion about general software issues.

Directing log outputs of several units to a specific file

Postby amrbekhit » Fri Nov 28, 2014 3:28 pm

Hello,

I've got an embedded system (custom hardware with ARMv5 CPU) running Arch (using the MultiPlatform download). To minimise writes to the on board SD card, I've mounted the rootfs as read only and some of the temporary directories (such as /tmp) as tmpfs. As such, system journal is written to the ram disc and is discarded on reboot.

However, I have a need to log the output of some systemd units (my own programs) to a file at a particular location. Is there a way to direct the log output of a set of units to a particular file somewhere?

Thanks

Amr
amrbekhit
 
Posts: 2
Joined: Wed Nov 26, 2014 5:04 pm

Re: Directing log outputs of several units to a specific fil

Postby moonman » Fri Nov 28, 2014 5:02 pm

You can redirect all output from journal to syslog-ng. Install syslog-ng and edit journal.conf (or is it journalctl.conf - can't remember). It is all in archwiki.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am


Return to General

Who is online

Users browsing this forum: No registered users and 37 guests