Skip to main content

Log management - rotating reducing deleting logs

Posted by natel broadband on Thu, 01/24/2013

Hello all,

I am trying to understand logs in asterisk / thirdlane. We have two servers running currently, one is an older one (v4 thirdlane). The logs are enormous.

asterisk2:/var/log/asterisk# ls -l
total 28413394
-rw-r--r-- 1 root root 0 2012-12-31 13:59 event_log
-rw-r--r-- 1 root root 0 2011-12-01 03:01 event_log.0
-rw-r--r-- 1 root root 0 2012-01-03 12:19 event_log.1
-rw-r--r-- 1 root root 0 2012-11-17 02:12 event_log.10
-rw-r--r-- 1 root root 0 2012-02-05 20:43 event_log.2
-rw-r--r-- 1 root root 0 2012-03-06 14:17 event_log.3
-rw-r--r-- 1 root root 0 2012-04-05 03:12 event_log.4
-rw-r--r-- 1 root root 0 2012-05-05 19:29 event_log.5
-rw-r--r-- 1 root root 0 2012-06-10 06:24 event_log.6
-rw-r--r-- 1 root root 0 2012-07-18 05:53 event_log.7
-rw-r--r-- 1 root root 0 2012-08-31 11:35 event_log.8
-rw-r--r-- 1 root root 0 2012-10-08 09:12 event_log.9
-rw-r--r-- 1 root root 1074084485 2013-01-23 15:16 full
-rw-r--r-- 1 root root 2147483647 2012-01-03 12:19 full.0
-rw-r--r-- 1 root root 2147483647 2012-02-05 20:43 full.1
-rw-r--r-- 1 root root 2147483647 2012-12-31 13:59 full.10
-rw-r--r-- 1 root root 2147483647 2012-03-06 14:17 full.2
-rw-r--r-- 1 root root 2147483647 2012-04-05 03:12 full.3
-rw-r--r-- 1 root root 2147483647 2012-05-05 19:29 full.4
-rw-r--r-- 1 root root 2147483647 2012-06-10 06:24 full.5
-rw-r--r-- 1 root root 2147483647 2012-07-18 05:53 full.6
-rw-r--r-- 1 root root 2147483647 2012-08-31 11:35 full.7
-rw-r--r-- 1 root root 2147483647 2012-10-08 09:12 full.8
-rw-r--r-- 1 root root 2147483647 2012-11-17 02:12 full.9
-rw-r--r-- 1 root root 468937283 2013-01-23 15:16 messages
-rw-r--r-- 1 root root 71297744 2012-01-03 12:19 messages.0
-rw-r--r-- 1 root root 121138956 2012-02-05 20:43 messages.1
-rw-r--r-- 1 root root 839996526 2012-12-31 13:58 messages.10
-rw-r--r-- 1 root root 205740269 2012-03-06 14:17 messages.2
-rw-r--r-- 1 root root 212182016 2012-04-05 03:12 messages.3
-rw-r--r-- 1 root root 191036465 2012-05-05 19:29 messages.4
-rw-r--r-- 1 root root 210816139 2012-06-10 06:24 messages.5
-rw-r--r-- 1 root root 212043079 2012-07-18 05:53 messages.6
-rw-r--r-- 1 root root 406943235 2012-08-31 11:35 messages.7
-rw-r--r-- 1 root root 751666154 2012-10-08 09:12 messages.8
-rw-r--r-- 1 root root 678655620 2012-11-17 02:12 messages.9

I would like to trim / delete / rotate these logs. What methods are available? What is a best practice for configuring these in the future?

Thank you for any help!