cronolog.org
flexible web log rotation
HOME
DOWNLOAD
FEATURES
USAGE
FAQ
BLOG
KNOWN BUGS
SECURITY
PATCHES
USERS
TO DO
HISTORY
LINKS
FEEDBACK
MAILING LIST
ADVERTISING

support cronolog development



Google   HELP


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CRONOLOG: Not cutting in middle of line



Luciano L.Mannucci wrote:


On Tuesday, Sep 2, 2003, at 15:51 Europe/Rome, Wim Godden wrote:

Is there some way to stop cronolog from cutting in the middle of a line
? It now splits a logfile in the middle of a line, instead of at the end
of a line.

I've noticed that too. I've tried to rewrite the io part of cronolog, switching from raw (open, close, read, write) to line buffered (fopen, fclose, fread, fwrite, fflush), though I'm not sure it is a good idea safety wise, and - of course - I'm still testing it.

Regards,

luciano mannucci.

Cronolog merely acts as a filter, reading whatever is available and writing to the current log file. It seems that someone in Canada is even using it to split an MP3 stream of radio broadcast, so one doesn't necessarily want it to start trying to parse the stream unless explicitly told to do so. However I am coming to the conclusion that it would be a good idea to have options to tell cronolog to interpret the data in various ways.


I wouldn't necessarily switch to buffered IO, but what could be done is to check the end of the buffer if the timer has gone off. If the last character (or two characters) is not the end of line marker then do a non-blocking read on the input to see if more data is available, and at least copy the remainder of the split line to the old log file before switching to the new one.

I have a trade fair on next week where my wife and I will be launching a new business, but I will try and get a new version of cronolog out after that, I did in fact have a tidied up version of cronolog just about ready at the start of the year, but then I lost my hard disk, and it took me a month just to catch up with my work for a client. A lot of my spare time this year has been taken up with catching up with things that were lost in that disk crash or the ensuing panic.

Regards
Andrew





Copyright © 1996-2010 Andrew Ford and Ford & Mason Ltd