logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg Jansen" <Georg.Jan...@FaktNet.com>
Subject RE: Controlling the date format of the logged events
Date Thu, 27 Oct 2005 08:53:03 GMT
Hi Ofri.

If you are using PatternLayout (for example in the FileAppender) you 
can use the %utcdate instead of the %date, se example below:

<conversionPattern value="%utcdate [%thread] %-5level %logger [%ndc] -
%message%newline"/>

Instead of 

<conversionPattern value="%date [%thread] %-5level %logger [%ndc] -
%message%newline"/>


In the AdoNetAppender you can use  RawUtcTimeStamplayout instead of
RawTimeStampLayout when defining the layout of the log_date parameter:

<layout type="log4net.Layout.RawUtcTimeStampLayout"/>
        
Instead of the default:
<layout type="log4net.Layout.RawTimeStampLayout"/>




Regards,
Georg
http://www.l4ndash.com - Log4Net Dashboard / Log Viewer


________________________________________
From: Ofri Sela [mailto:ofris@prolify.com] 
Sent: 27. oktober 2005 10:02
To: log4net-user@logging.apache.org
Subject: Controlling the date format of the logged events

In my application I need to be able to store my log messages date format as
UTC. It seems that the default used by log4net is local time format. Is
there a way to control the date time format (preferably through
configuration)?

Any help would be greatly appreciated. 


Ofri




Mime
View raw message