Page 1 of 1

access.log how to remove it?

Posted: 08 Sep 2009, 17:11
by squadra
This file causes the error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes) in /usr/share/codeigniter/system/libraries/Loader.php on line 651

How can i empty this file automatically each month or so? Or how to remove it so i can monitor it again? I thought all logs were in rotation ??

Greetings,

Debian n00b

Re: access.log how to remove it?

Posted: 09 Sep 2009, 04:16
by asparak
Check logrotate is running, but you can usually copy it off to a backup device if you want and create a new file with the same permissions. I use 'touch', CHMOD and CHOWN to do it most often if I'm in a hurry

Re: access.log how to remove it?

Posted: 09 Sep 2009, 06:15
by carl
the fastest way to truncate the file is to type following:

Code: Select all

:>/var/log/apache2/access.log

Re: access.log how to remove it?

Posted: 17 Nov 2009, 02:31
by janeks
How to set up the maximum size of access.log (log rotate)?
Will it not be better?

Janeks

Re: access.log how to remove it?

Posted: 17 Nov 2009, 02:42
by asparak
An example from the logrotate man page.

"/var/log/httpd/access.log" /var/log/httpd/error.log {
rotate 5
mail [email protected]
size=100k
sharedscripts
postrotate
/sbin/killall -HUP httpd
endscript
}

There is a size parameter that you can use to determine how big or how often you want to run. There is also a force option, to make it do it, even if logrotate doesn't think its necessary.

Re: access.log how to remove it?

Posted: 17 Nov 2009, 03:14
by janeks
Yes I can do it and I will, but I think it will be better if it had already there so that users do not face with:

Code: Select all

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes) in /usr/share/codeigniter/system/libraries/Loader.php on line 651
brgds
Janeks