How to Configure Remote Syslog Logging: Difference between revisions

From RidgeRun Developer Wiki
Line 18: Line 18:


SYSLOGD="-r"  
SYSLOGD="-r"  


Save the file and restart '''syslogd''' by doing:  
Save the file and restart '''syslogd''' by doing:  

Revision as of 16:21, 3 September 2010

General Information

syslogd is the Linux system logging utility that take care of filling up your files in /var/log when it is asked to.

On a standard system, logging is only done on the local drive. But syslog can be configured to receive logging from a remote client, or to send logging to a remote syslog server.

This How to gives the basic procedure need it for configuring a remote syslog server (in your PC) and client (in your board with our SDK filesystem structure).

Configuring BusyBox for setting up the syslogd server

The changes on this side are minimal. Basically you have to tell syslogd to listen for remote messages. To enable this you have to go and edit the following file in your host machine:

host$ sudo <Prefer text editor>/etc/default/syslogd

Make sure in this file SYSLOGD is set to:

SYSLOGD="-r"

Save the file and restart syslogd by doing:

host$ sudo /etc/init.d/syslogd restart 

Configuring BusyBox for setting up the syslogd remote feature using our SDK FileSystem structure in the board

This can be done in two ways.

1) The first one, it can be done when the board has boot up and Linux is also running up. Our file system initializes a default configuration for syslogd, then for add the remote feature you have to stop this process and configure a new one following this steps:

target# ps aux | grep syslogd

If there is a syslogd process running then kill it.

target# killall -9 syslogd

Create a new process of syslogd enabling the remote feature:

target#  /sbin/syslogd  -R <serverip>:<port using by UDP (default PORT=514/UDP)>  -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages>

Example:

target#  /sbin/syslogd  -R  10.251.101.60  -L -O /var/log/messages                                           


2) For the second way to this, the work should be done if you are familiar with our SDK build system and has to be set it before you create the images of the kernel and file system with it. If not just follow the first case, is the easy way to do this.

Generally we have an script in our file system that initializes syslogd when the board boot up the kernel and the file system customized by us. For setting up the syslogd remote edit this file in the host side:

host$  <Prefer text editor> $(DEVDIR)/fs/overlay/etc/init.d/ syslogd 

As the first way described above, add the following line:

/sbin/syslogd  -R <serverip>:<port using by UDP (default PORT=514/UDP)>  -L (this save the messages in the server and the client. Optional) -O <PATH where you want to send the log messages>

Save the file and build and install the images create it by our SDK build system.

This will automatically execute the syslogd with the remote feature anytime the board is boot up and the file system loads.

You can check it by doing:

target# ps aux | grep syslogd


For checking configuration has successfully done, try the following:

target# while sleep 2 ; do date ; done | logger -t "DATE:"
target# tail -f <PATH (Default:/var/log/messages)>

To check the messages are been sent to the server:

host# tail -f <PATH (Default:/var/log/messages)