Ron looks like a really good idea. I like the embedding of properties
into the Option string, sort of like the was C# attributes are defined.
We may need to think about how to quote or escape the contents so that
the format string can contain a comma if the user wants that. Maybe
something like

%date{format='yyyy-MM-dd hh:mm:ss tt',hourOffset=-4}

Actually using single quote is not great for the date format string as
that uses single quote to mean literal, so you could end up writing
something like:

%date{format='''DATE: ''yyyy-MM-dd ''TIME: ''hh:mm:ss tt',hourOffset=-4}

If double quote ('') is used to escape a quote ('). Maybe we could come
up with a generic way of handling these similar to the XML configurator.

My only problem with the code is that some places use half hour
increments in the timezone offset so the hourOffset must be a float or
something like that so that Australian Central Daylight Time can have
hourOffset=10.5

Cheers,
Nicko

> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: 06 October 2005 03:25
> To: [email protected]
> Subject: %date pattern and timezones
> 
> I live in the EST timezone (Eastern Standard Time, UTC - 4 
> hours). I'm developing an application that is hosted by a 3rd 
> party hosting company in the MST timezone (Mountain Standard 
> Time, UTC - 6 hours). I want the timestamps in the log file 
> to be in my timezone. I'm not a timezone expert but here's a 
> quick pattern converter that accepts an hour
> offset:
> 
>  %date{format=yyyy-MM-dd hh:mm:ss tt,hourOffset=-4}
> 
> Here's my first implementation:
> 
> 
> http://www.ronosaurus.com/log4net/HourOffsetDatePatternConvert
> er.cs.txt
> 
> Maybe the end result could be:
> 
>  %date{yyyy-MM-dd hh:mm:ss tt,timeZone=EST}
> 
> Comments?
> 
> - Ron
> 
> 

Reply via email to