This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

log files

Old posts that have not been replied to for several years.
Locked
o
otterboyy

Post by otterboyy »

Yes, another question from yours truly. But I must say I'm learning more and more. The question today has to do with log files.

With the way I have implemented my IRC server and eggbot, I have a need to log all "chat" in a particular channel. I have done this with
logfile p #helpdesk "logs/helpchat.log"

The above works well and logs the appropriate channel messages. The problem comes in with the fact that on an hourly basis, I need to publish the previous hours log file to a webpage.

The way I am currently trying to implement this is through a crontab in linux with a simple script that moves the file from the current location in "/logs/" to the web directory and then I am recreating the file name in the "/logs/" directory with a 'touch' command and the appropriate channame.log.daymonthyear file format that egg creates for the filename.

The problem comes in that once I move the original file that egg creates and 'touch' it to recreate empty, that the channel chatter never gets posted to the log file anymore.

I have tried taking a blank copy of the log file that egg creates and through the script (not TCL by the way, just a bash script) copy that blank file back to the "/logs/" directory after I have moved the hour of channel chat out.

Any suggestions on this or a better or different way to do this?

Thank you,
Otterboyy
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

One method is to use your web-script to read all the current lines form the file, and store the last read position from the file, in a seperate file. Then next time it comes to reading the file, you start reading form the last known possition, once again, storing the last know possition at the end.
o
otterboyy

Post by otterboyy »

Hmm.. okay. I think I can figure out how to do that. Have to give that a shot.

Do you (or anyone for that matter) know why eggdrop won't write to the log file after I move it out copy a blank one back in?

Thanks in advance,

Otterboyy
Locked