Date in Log File

Andreas Ericsson ae at op5.se
Tue Apr 22 12:26:11 CEST 2008


Craig wrote:
> Arno Lehmann wrote:
>>>  * naglog.c
>>>  *
>>>  * This program was written to display Nagios logs with the timestamp
>>>  * translated to human-readable (European, Americans are only barely human)
> 
> Would it be reasonable to add a "log_format" configuration directive to 
> the config file?
> 
> I have no idea what kind of havoc this may wreak on other parts of the 
> system. I'm just asking since you see that kind of thing in other apps 
> (eg. Apache).
> 
> Please keep in mind that I am very new to the internals of nagios... so, 
> if this is a blatantly stupid idea, just point out why. :)
> 

I pointed it out earlier in this thread: The logs are used by the CGI's
when one creates reports of historical data (such as trends, availability
reports etc, etc). Changing the format in the logs means you'll have to
change the way those programs parse it, but you can't just modify it so
they grok a new format, you have to have the capability of understanding
several.

Making the timestamp format configurable would be extremely stupid as
you'd have to add code to handle each of the formats separately, and it
still wouldn't please everyone until you added something like the way
php's date() function does it, at which point it becomes totally
unparsable, even for humans (well, apart from the human who decided the
format anyways). Or can you perhaps tell me which date "070805" refers to?

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone




More information about the Developers mailing list