#1  
Old 25th July 2006, 00:07
fobicodam fobicodam is offline
Senior Member
 
Join Date: Apr 2006
Location: Argentina
Posts: 346
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to fobicodam
Default logs.php

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) ?
Reply With Quote
  #2  
Old 25th July 2006, 09:48
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 19,805
Thanks: 285
Thanked 1,805 Times in 1,357 Posts
Default

To get a daily logfile, modify the function:

Code:
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:

Code:
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!
__________________
Till Brehm
--
http://www.projektfarm.com/en/
Reply With Quote
  #3  
Old 12th April 2008, 14:14
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 227
Thanks: 14
Thanked 4 Times in 4 Posts
Send a message via ICQ to radim_h
Default

will this modification solve problem with logs over 2GB ?
(as i have about 7GB of logs everyday)
Reply With Quote
  #4  
Old 12th April 2008, 19:36
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 19,805
Thanks: 285
Thanked 1,805 Times in 1,357 Posts
Default

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.
__________________
Till Brehm
--
http://www.projektfarm.com/en/
Reply With Quote
  #5  
Old 13th April 2008, 15:42
radim_h radim_h is offline
Senior Member
 
Join Date: Jan 2007
Location: Prague, Czech
Posts: 227
Thanks: 14
Thanked 4 Times in 4 Posts
Send a message via ICQ to radim_h
Default

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)

Last edited by radim_h; 13th April 2008 at 20:04.
Reply With Quote
  #6  
Old 13th April 2008, 21:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
Default

You should update to ISPConfig 2.2.22, it supports log files > 2GB.
__________________
Falko
--
Follow me on:
Reply With Quote
  #7  
Old 1st October 2008, 11:36
ADM ADM is offline
Junior Member
 
Join Date: Apr 2007
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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

Last edited by ADM; 1st October 2008 at 11:47.
Reply With Quote
  #8  
Old 1st October 2008, 13:34
vogelor vogelor is offline
ISPConfig Developer
 
Join Date: Jan 2007
Location: Wernau, Germany
Posts: 168
Thanks: 28
Thanked 26 Times in 18 Posts
Default

If i remember right (please be patient, if not) there is a little flaw still remaining. please add
PHP Code:
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)
__________________
Erst, wenn man dreimal auf Holz klopfen will, stellt man fest, dass die Welt nur noch aus Aluminium und Plastik besteht.
http://www.muv.com
Reply With Quote
  #9  
Old 2nd October 2008, 16:22
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
Default

Quote:
Originally Posted by vogelor View Post
If i remember right (please be patient, if not) there is a little flaw still remaining. please add
PHP Code:
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.
__________________
Falko
--
Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
vogelor (2nd October 2008)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
logs.php error timehost Installation/Configuration 4 27th December 2005 18:48


All times are GMT +2. The time now is 02:59.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions
Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com

Red Hat Virtual Experience - a free virtual event. Dec. 9th