New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

access.log how to remove it?

Got problems with your B2 or B3? Share and get helped!
Post Reply
squadra
Posts: 96
Joined: 19 Sep 2008, 09:02

access.log how to remove it?

Post 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
asparak
Posts: 173
Joined: 08 Jun 2009, 07:38

Re: access.log how to remove it?

Post 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
carl
Posts: 474
Joined: 07 May 2008, 04:41

Re: access.log how to remove it?

Post by carl »

the fastest way to truncate the file is to type following:

Code: Select all

:>/var/log/apache2/access.log
/Carl Fürstenberg, Excito Software Developer
http://www.excito.com
support@excito.com
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Re: access.log how to remove it?

Post by janeks »

How to set up the maximum size of access.log (log rotate)?
Will it not be better?

Janeks
asparak
Posts: 173
Joined: 08 Jun 2009, 07:38

Re: access.log how to remove it?

Post by asparak »

An example from the logrotate man page.

"/var/log/httpd/access.log" /var/log/httpd/error.log {
rotate 5
mail www@my.org
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.
janeks
Posts: 78
Joined: 15 Sep 2008, 02:02

Re: access.log how to remove it?

Post 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
Post Reply