Jump to content

Photo
* * * * * 3 votes

How to prevent your site's log files getting bigger...


  • Please log in to reply
9 replies to this topic

#1 reasse

reasse

    Level 2

  • Members
  • Level
  • 53 points
  • 49 posts
    • Gender:Not Telling

Posted 22 January 2013 - 11:19 PM

I found the big error on se4 platform. The Social Engine 4 Platform creates the following log files :

translate.log
task.log
main.log
install.log

the se4 platform create and continue adding logs into log files without clears it ...
this is a big error especiality main.log i found that mine main.log file is 700mb
this is a huge space for hostings thats provides 2 or 8 gb of space ...
here is one code that you need to create in file chronjob.php and set it in your chron jobs to run every 12h
this code will erase the log files and prevent filling your space ;) :

name of the file : chronjob.php
<?php
fopen('temporary/log/install.log', 'w');
fopen('temporary/log/main.log', 'w');
fopen('temporary/log/tasks.log', 'w');
fopen('temporary/log/translate.log', 'w');
?>

you also need to edit your .htaccess using my previous topic: Editing .HTACCESS File to Display non social engine 4 php , html files & folders

if you are doing all right the php code will run every 12 hour and erase the content of log files without deleteing the files itself..

Here im attaching the chronjob.php file and mine .htaccess file you just need to download and extract them in your root directory and set the crono jobs of your hosting to run chronjob.php file every 12 hours ;) :

Attached File  log files fixation.rar   834bytes   69 downloads

here you can set free chrono job if your hosting provider does not present chrono jobs or if u does not want to use your hosting chrono jobs: Free Chrono Jobs
BG-DW-PRO Web Design Team Bulgaria

Creating Web Browser Based Games , Personal Websites , Business Websites
Editing and Modifying All kind of Websites and Network Tools (!!!NOT NULLING!!!)

#2 gastre

gastre

    Level 3

  • Members
  • Level
  • 6 points
  • 93 posts

Posted 22 January 2013 - 11:23 PM

Up!!

#3 socialtimegmx

socialtimegmx

    Pro Developer

  • Premium
  • Level
  • 141 points
  • 465 posts
    • Gender:Not Telling


Users Awards

Posted 22 January 2013 - 11:23 PM

great work mate.. keep it up. you save our space
Stay Hungry Stay Foolish -

#4 samin

samin

    Level 3

  • Members
  • Level
  • 29 points
  • 54 posts

Posted 03 April 2013 - 10:41 PM

I found the big error on se4 platform. The Social Engine 4 Platform creates the following log files :

translate.log
task.log
main.log
install.log

the se4 platform create and continue adding logs into log files without clears it ...
this is a big error especiality main.log i found that mine main.log file is 700mb
this is a huge space for hostings thats provides 2 or 8 gb of space ...
here is one code that you need to create in file chronjob.php and set it in your chron jobs to run every 12h
this code will erase the log files and prevent filling your space ;) :

name of the file : chronjob.php

 <?php
 fopen('temporary/log/install.log', 'w');
 fopen('temporary/log/main.log', 'w');
 fopen('temporary/log/tasks.log', 'w');
 fopen('temporary/log/translate.log', 'w');
 ?>

you also need to edit your .htaccess using my previous topic: Editing .HTACCESS File to Display non social engine 4 php , html files & folders

if you are doing all right the php code will run every 12 hour and erase the content of log files without deleteing the files itself..

Here im attaching the chronjob.php file and mine .htaccess file you just need to download and extract them in your root directory and set the crono jobs of your hosting to run chronjob.php file every 12 hours ;) :

Attached File  log files fixation.rar   834bytes   69 downloads

here you can set free chrono job if your hosting provider does not present chrono jobs or if u does not want to use your hosting chrono jobs: Free Chrono Jobs


This is a great solution, but i am seeing a bigger problem here than just the SE logs.

The actual server logs located in /etc/httpd/domlogs/ increase pretty fast.
I am running a site with no users, so basically i am the only one using the site, and as you can see in the partial log files below, the chat is constantly running.
The problem becomes more apparent when the system tries to rotate the logs and the cpu usage goes high and therefore an even slower site.


Do you have any sultions for this?


xx.xx.xx.xxx - - [03/Apr/2013:15:37:50 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nd HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:37:51 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3574 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:37:51 -0700] "GET /application/lite.php?module=advmenusystem&name=total&viewer_id=1 HTTP/1.1" 200 60 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:37:55 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ne HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:37:57 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3575 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:00 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nf HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:02 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3576 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:06 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ng HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:07 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3577 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:11 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nh HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:13 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3578 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:16 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ni HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
xx.xx.xx.xxx - - [03/Apr/2013:15:38:18 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3579 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"



#5 reasse

reasse

    Level 2

  • Members
  • Level
  • 53 points
  • 49 posts
    • Gender:Not Telling

Posted 05 April 2013 - 03:34 PM

This is a great solution, but i am seeing a bigger problem here than just the SE logs.

The actual server logs located in /etc/httpd/domlogs/ increase pretty fast.
I am running a site with no users, so basically i am the only one using the site, and as you can see in the partial log files below, the chat is constantly running.
The problem becomes more apparent when the system tries to rotate the logs and the cpu usage goes high and therefore an even slower site.


Do you have any sultions for this?

 
 xx.xx.xx.xxx - - [03/Apr/2013:15:37:50 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nd HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:37:51 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3574 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:37:51 -0700] "GET /application/lite.php?module=advmenusystem&name=total&viewer_id=1 HTTP/1.1" 200 60 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:37:55 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ne HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:37:57 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3575 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:00 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nf HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:02 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3576 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:06 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ng HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:07 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3577 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:11 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3nh HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:13 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3578 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:16 -0700] "POST /?m=lite&module=chat&action=ping&hf2vr3ni HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31"
 xx.xx.xx.xxx - - [03/Apr/2013:15:38:18 -0700] "POST /?m=lite&module=chat&action=ping&hf2w3579 HTTP/1.1" 200 66 "http://sitename.com/profile/admin" "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0"
 


you need also to flush that log file by adding new line below my code before <? and set location to problemed log file use ../ , .././ to access to that previous directory because if u tape "etc/httpd/domlogs" the script will try to find that directory in public-html or htdocs ...
BG-DW-PRO Web Design Team Bulgaria

Creating Web Browser Based Games , Personal Websites , Business Websites
Editing and Modifying All kind of Websites and Network Tools (!!!NOT NULLING!!!)

#6 Kikke

Kikke

    Level 4

  • Members
  • Level
  • 28 points
  • 142 posts

Posted 07 April 2013 - 04:15 AM

In case somebody needs it...

If running CPanel, execute and add the following:

/usr/bin/curl http://yourdomain/chronjob.php


Hope it helps someone :yes:

#7 JoJoomla

JoJoomla

    Level 4

  • Members
  • Level
  • 35 points
  • 125 posts

Posted 08 April 2013 - 10:29 AM

Great work BUT:sometimes maybe I need the log files. So it would be nice to check the status size of the log. So it will only clean it when it is over 2MB or something like that.

#8 Jrod

Jrod

    Level 5

  • Members
  • Level
  • 33 points
  • 252 posts
    • Gender:Male

Posted 08 April 2013 - 02:16 PM

Thanks for sharing, nice little trick. But as JoJoomla is also saying, sometimes you need to check the error log, so my suggestion would simply be just to clear it manually once in a while. Its easyly done from the Admin panel.
But its a good solution if you dont care about whats in your error log. Thumbs up for sharing :)

#9 reasse

reasse

    Level 2

  • Members
  • Level
  • 53 points
  • 49 posts
    • Gender:Not Telling

Posted 09 April 2013 - 09:45 PM

Great work BUT:sometimes maybe I need the log files. So it would be nice to check the status size of the log. So it will only clean it when it is over 2MB or something like that.


For that i can't help but it's not normal error log be bigger than ur site almoust 10000% bigger Example 17.7mb site - error logs 900mb...
BG-DW-PRO Web Design Team Bulgaria

Creating Web Browser Based Games , Personal Websites , Business Websites
Editing and Modifying All kind of Websites and Network Tools (!!!NOT NULLING!!!)

#10 ThomasAtror

ThomasAtror

    Level 1

  • Members
  • Level
  • 0 points
  • 5 posts

Posted 01 September 2021 - 04:38 AM

FREDERICKSBURG, Va.--(BUSINESS WIRE)--RingLeader, the leading provider of internet phone services for businesses of all sizes, announced today that in response to the novel coronavirus, it is pledging 25,000 months of free service on its CrowdVoice Americas platform, a secure mobile social communications application. By extending its free trial subscription of CrowdVoice to up to 90 days per customer, RingLeader aims to help travelers, immigrants and expats who need a reliable, secure and affordable means to keep in regular touch with friends, family and colleagues wherever they may be in North America.

Also you can visit BusinessWire media outlet portal to check the Augmented Reality Smartglasses Industry Latest News and Tips and many more interesting posts and breaking industry news, in North America and around the globe.

Article original source: RingLeader to Extend Free Subscription of Its North American Calling Services 73d5ef7




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


All the resources listed here are just for testing purpose and they shouldn't be used at any commercial environment without a valid license.
Those are for users who wants to try them before buy. Help the developer to build it better by purchasing them from original authors.