View Full Version : logs.php
fobicodam
24th July 2006, 23:07
Hi, how can i modify the logs.php to check if the web.log file is bigger than 2Gb ? or better, to create a webXX.log everyday (where XX is the day number) ?
till
25th July 2006, 08:48
To get a daily logfile, modify the function:
function get_filename($virtual_host) {
global $webroot, $jahr, $monat, $mod;
if(!is_dir("$webroot/$virtual_host/log/$jahr/$monat")) $mod->file->mkdirs("$webroot/$virtual_host/log/$jahr/$monat");
return "$webroot/$virtual_host/log/$jahr/$monat/web.log";
}
to:
function get_filename($virtual_host) {
global $webroot, $jahr, $monat, $mod, $tag;
if(!is_dir("$webroot/$virtual_host/log/$jahr/$monat")) $mod->file->mkdirs("$webroot/$virtual_host/log/$jahr/$monat");
return "$webroot/$virtual_host/log/$jahr/$monat/web_$tag.log";
}
This modification is untested!
radim_h
12th April 2008, 13:14
will this modification solve problem with logs over 2GB ?
(as i have about 7GB of logs everyday)
till
12th April 2008, 18:36
This will not solve the problem if your logfile is > 2GB a day. The problem is not in ISPConfig or in one of the ISPConfig scripts, the problem is that PHP is not able to open files > 2 GB There is a switch in the PHP configure script to enable files > 2 GB, but the last time it did not work as falko tested it. But its worth a try if it works on your system.
radim_h
13th April 2008, 14:42
i found it now, that it is not httpd log, but monthly log for each site, there was one site with 2GB log, noe everything works fine
have someone tried that daily rotate script? .o)
falko
13th April 2008, 20:09
You should update to ISPConfig 2.2.22, it supports log files > 2GB.
ADM
1st October 2008, 10:36
I'm using ISPConfig 2.2.25 but same problem:
/bin/sh: line 1: 23006
/root/ispconfig/php/php
/root/ispconfig/scripts/shell/logs.php >&/dev/null
Any hint?
l /home/web82/log/2008/09/
-rw-r--r-- 1 web82_admin web82 144727482 2008-09-02 00:30 web_01.log
-rw-r--r-- 1 web82_admin web82 142544595 2008-09-03 00:30 web_02.log
-rw-r--r-- 1 web82_admin web82 143661727 2008-09-04 00:30 web_03.log
-rw-r--r-- 1 web82_admin web82 144564332 2008-09-05 00:30 web_04.log
-rw-r--r-- 1 web82_admin web82 136941101 2008-09-06 00:30 web_05.log
-rw-r--r-- 1 web82_admin web82 106465926 2008-09-07 00:30 web_06.log
-rw-r--r-- 1 web82_admin web82 114685074 2008-09-08 00:30 web_07.log
-rw-r--r-- 1 web82_admin web82 151852150 2008-09-09 00:30 web_08.log
-rw-r--r-- 1 web82_admin web82 142440923 2008-09-10 00:30 web_09.log
-rw-r--r-- 1 web82_admin web82 140549247 2008-09-11 00:30 web_10.log
-rw-r--r-- 1 web82_admin web82 135958083 2008-09-12 00:30 web_11.log
-rw-r--r-- 1 web82_admin web82 2147483647 2008-09-30 00:30 web.log
vogelor
1st October 2008, 12:34
If i remember right (please be patient, if not) there is a little flaw still remaining. please add
global $tag
to the function get_filename, so that it looks like this:
function get_filename($virtual_host) {
global $webroot, $jahr, $monat, $mod, $tag;
if(!is_dir("$webroot/$virtual_host/log/$jahr/$monat")) $mod->file->mkdirs("$webroot/$virtual_host/log/$jahr/$monat");
return "$webroot/$virtual_host/log/$jahr/$monat/web_$tag.log";
}
(if i remember right, they "forgot" $tag in the global list)
falko
2nd October 2008, 15:22
If i remember right (please be patient, if not) there is a little flaw still remaining. please add
global $tag
to the function get_filename, so that it looks like this:
function get_filename($virtual_host) {
global $webroot, $jahr, $monat, $mod, $tag;
if(!is_dir("$webroot/$virtual_host/log/$jahr/$monat")) $mod->file->mkdirs("$webroot/$virtual_host/log/$jahr/$monat");
return "$webroot/$virtual_host/log/$jahr/$monat/web_$tag.log";
}
(if i remember right, they "forgot" $tag in the global list)
I've added this to our bugtracker.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.