1

I'm using log4net to write logs in asp .net application,log time are written in local server time but I need in utc format and is there any time zone specific tags already available in log4net?

Anita
  • 11
  • 4
  • Possible duplicate of [Log4Net: Log with UTC times](http://stackoverflow.com/questions/10012083/log4net-log-with-utc-times) – CodeCaster Sep 09 '16 at 20:05

1 Answers1

1

The Parameter your log4net value you are looking for is %utcdate For example when you add a database parameter to your configfile:

 <parameter>
    <parameterName value="@utcdate" />
    <dbType value="DateTime" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%utcdate{yyyy-MM-dd HH:mm:ss}" />
    </layout>
  </parameter>

source: http://www.codeproject.com/Articles/403936/log4Net-and-SQLite

jan-seins
  • 1,253
  • 1
  • 18
  • 31