Bering-uClibc 6.x - User Guide - Basic Configuration - Log Files
|Basic Configuration - Log Files|
|Prev||Bering-uClibc 6.x - User Guide||Next|
This chapter explains the location and contents of log files generated on a LEAF Bering-uClibc router, the configuration
syslog-ng, maintenance with
logrotate and how to use
In a space constraint and long running environment like LEAF Bering-uClibc, it will be useful to understand how log files, which tends to grow unlimited, are created and maintained.
Note: Remote logging is not described in this chapter.
Location and contents of main log files
The log files are usually written into
/var/log. Some programs writes their log files in subdirectory of
Log files present by default are:
auth.log- This file keeps login information, e.g. the
loginand the ssh server
dropbearwrites into this file.
cron.log- Keeps information of jobs started from cron.
daemon.log- The daemon log at
/var/log/daemon.logand contains information about running system and application daemons such as
hostapddaemon, the dns daemon
dnsmasqor the MySQL database daemon
mysqld. This can help you trouble-shoot problems with a particular daemon.
debug- The debug log provides detailed debug messages from system and applications which log to
syslogdat the DEBUG level.
dmesg- It's a copy of the
dmesgoutput from the kernel booting, showing the devices it has found and if it has been able to configure them at all (aside from userland configuration).
Configuration of syslog-ng
Log file maintenance
The task of log file maintenance is accomplished by
logrotate is started daily, weekly and monthly from
Log files will be compressed and rotated if a given size (default 1MB) is reached.
It also restarts a daemon after log rotation if needed. The files are rotated up to four generations.
logrotate keeps the configuration files in
/etc/logrotate.d, usually named after the application generating the log file (e.g
For the default log files (
wtmp) the logrotation configuration has been added to
The following example is the default logrotate.d file
/var/log/syslog and other common log files created by LEAF Bering-uClibc at boot time.
# add files to be rotated (daily, weekly, monthly) # NOTE: depends if LOGSIZE has been reached LOGS_DAILY="syslog user.log daemon.log cron.log auth.log debug" LOGS_WEEKLY="" LOGS_MONTLY="wtmp" # LOGSIZE - size in kb when logrotate move and compress log files LOGSIZE=1024 # DAEMON - restart this service after logrotation DAEMON=syslog-ng # METHOD - restart command METHOD=restart # USER - set user permission #USER=sh-httpd # GROUP - set group permission #GROUP=adm # if set to one the first iteration will be compressed COMPRESS_ALL=1
Using Spacecheck in lrp.conf