Page 1 of 1

How clear access log and error log

Posted: Thu Jun 23, 2016 3:16 pm
by mhh2
Hi
Log of my server have big size, I want clear access log and error log in server, how do this?

Re: How clear access log and error log

Posted: Thu Jun 23, 2016 4:00 pm
by Syeef
I always do it like this, for example:

Code: Select all

cat /dev/null > /var/log/exim/main.log
Don't know if there is any better way of achieving this, but it works.

Re: How clear access log and error log

Posted: Thu Jun 23, 2016 8:35 pm
by tjebbeke
Maybe it's better to solve the errors in error log?

you can use
echo "" > /yourerrorlog

Re: How clear access log and error log

Posted: Wed Jul 27, 2016 12:27 pm
by skurudo

Re: How clear access log and error log

Posted: Wed Jul 27, 2016 2:00 pm
by mehargags
Big logs signify a problem... it is always important to check why log is bloating so much

Re: How clear access log and error log

Posted: Thu Jul 28, 2016 6:43 am
by skurudo
mehargags wrote:Big logs signify a problem... it is always important to check why log is bloating so much
Yes, but it also can tell about a large number of requests -- popularity, downloaders (site cloners), ddos :)