Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-11-2006, 03:17 PM Compiling Error Logs
fambi's Avatar
Ultra Talker

Posts: 339
Trades: 0
Hi everyone!

Does anyone have any ready-made scripts that can be cron-jobbed to:

1. Go through a site's directories.
2. Extract the content of error_logs within each directory.
3. Compile them all into one new one which can be emailed (for example).
4. Delete all the old ones.

We do have our own error_handling script, but PHP insists on recording certain errors in the directories in which they took place and going through all the directories manually and on a regular basis is just not realistic.

We have a script that can go through directories recursively, but steps 2 - 4 are the tricky part.

Many thanks!
__________________

Please login or register to view this content. Registration is FREE
from a
Please login or register to view this content. Registration is FREE
is easy!
Read this
Please login or register to view this content. Registration is FREE
that uses our
Please login or register to view this content. Registration is FREE
.
fambi is offline
Reply With Quote
View Public Profile Visit fambi's homepage!
 
 
Register now for full access!
Old 06-12-2006, 06:01 AM Re: Compiling Error Logs
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Use redirection to concataate the files.

I.E
parts 3 & 4

cat $log >> main_log
rm $log

Which is a bare bones method to do what your after. It simply echo's each log into a main log and then deletes that log. Just make sure your main log is not in the same dir as the other ones.

Let us know

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 06-12-2006, 06:04 AM Re: Compiling Error Logs
fambi's Avatar
Ultra Talker

Posts: 339
Trades: 0
Ibbo...

Thanks for the contribution, but i have no idea what you're talking about, especially (what seems to be) a snippet of code.
__________________

Please login or register to view this content. Registration is FREE
from a
Please login or register to view this content. Registration is FREE
is easy!
Read this
Please login or register to view this content. Registration is FREE
that uses our
Please login or register to view this content. Registration is FREE
.
fambi is offline
Reply With Quote
View Public Profile Visit fambi's homepage!
 
Old 06-12-2006, 09:16 AM Re: Compiling Error Logs
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Well you mentioned that you had a script that would trawl your web directories. (and that it does this part well)

So with you now trawling I assume you know what log files to look into.

Once you find that log file you can spit its contents out using the command cat. Apply some redirection to this >> (doubled for append) and you get

cat log >> /path/to/main/log

which is similar to echo this text file out to screen 'cat' but catch it '>>' and put it into that other file '/path/to/main/log'. Once thats done you can then rm (remove) log.

If you drop us in your script that trawls the dir's I can edit it for you and post it back. Would be easier I suppose than making assumptions and documenting them here.

Failing that it wont take long to put one together. I do assume that when your asking for cron job scripts that your on a Linux box?

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf

Last edited by ibbo; 06-12-2006 at 09:17 AM..
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Compiling Error Logs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13223 seconds with 12 queries