LOG-file

---

increase system log message

Edit Log File - Webmin->system->Log File Rotation

1) Rotation schedule-> Monthly

2) Number of old logs to keep-> 12

save

                                                                      OR

# vim /etc/logrotate.d/syslog

----------------------------

/var/log/cron

/var/log/maillog

/var/log/messages

/var/log/secure

/var/log/spooler                            

{                                                   #-> Original File

    missingok

    sharedscripts

    postrotate

        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

    endscript

}

---Edit-------Monthly  - 12 File ---------------------------

/var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler {

        missingok

        sharedscripts

        postrotate

        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

        endscript

        monthly

        rotate 12

}

------------------------------------

service rsyslog restart

---------- On CentOS, RHEL and Fedora ---------- 

#  yum -y install logrotate

#    dnf install logrotate -y

# cat /etc/rsyslog.conf *.info;mail.none;authpriv.none;cron.none                /var/log/messages authpriv.*                                              /var/log/secure mail.*                                                  -/var/log/maillog cron.*                                                  /var/log/cron *.emerg                                                 * uucp,news.crit                                          /var/log/spooler local7.*                                                /var/log/boot.log

#  vi /etc/logrotate.conf

weekly rotate 4 create include /etc/logrotate.d /var/log/wtmp {     monthly     minsize 1M     create 0664 root utmp     rotate 1 }

As per the above logrotate configuration file the logs are rotated every week (renaming the existing log to filename.number order):

minsize 1M – logrotate runs and trims the messages files if the file size is equal to or greater than 1 MB.

rotate 4 – keep the most recent 4 files while rotating.

create – create new file while rotating with specified permission and ownership.

include – include the files mentioned here for the daemon specific log rotation settings.

# ls -l /var/log/messages* -rw------- 1 root root   1973 Jun 10 15:07 /var/log/messages -rw------- 1 root root  10866 Jun  6 04:02 /var/log/messages.1 -rw------- 1 root root  19931 May 30 04:02 /var/log/messages.2 -rw------- 1 root root 238772 May 23 04:02 /var/log/messages.3 -rw------- 1 root root 171450 May 14 18:29 /var/log/messages.4

------------------------------------------------------------------------------------------------------------------

[root@]#  cp /etc/logrotate.d/syslog  cp /etc/logrotate.d/syslog.ORG

[root@]#  vi /etc/logrotate.d/syslog 

/var/log/cron

/var/log/maillog

/var/log/messages

/var/log/secure

/var/log/spooler

{

    sharedscripts

    postrotate

        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

    endscript

}

                            ---  just ADD --------------

/var/log/cron

/var/log/maillog

/var/log/messages

/var/log/secure

/var/log/spooler

{

        monthly

rotate 12

size 100M

compress

delaycompress

missingok

notifempty

create 644 root root

        sharedscripts

       postrotate

        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

    endscript

}

                             ******************************************************************************************************

For RHEL 6 :

# service rsyslogd restart

For RHEL 7 :

# systemctl restart rsyslog

Let’s take a look at the configuration file of the dpkg package manager tool.

$ cat -n /etc/logrotate.d/dpkg

# vim /etc/logrotate.d/supervisor /var/log/supervisor/superviz.log {         daily         create 0640 root root         missingok         dateext         rotate 3         size=1M         notifempty         sharedscripts         mail alain@linoxide.com }

 --------------------X-------------------------

Enable clamd by editing /etc/clamd.d/scan.conf like this:

# Example

LogFile /var/log/clamd.scan

LogTime yes

LogSyslog yes

LogFacility LOG_MAIL

PidFile /var/run/clamd.scan/clamd.pid

LocalSocket /var/run/clamd.scan/clamd.sock

Create the log file:

touch /var/log/clamd.scan

chown :clamscan $_

chmod 0660 $_

Now enable and start the service:

systemctl  enable clamd@scan

systemctl  start clamd@scan

systemctl  status clamd@scan

What’s in these Linux Logs?

-----------