Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Best practice would be to always record log times as UTC:</p> <pre><code>DateTime now = DateTime.UtcNow; </code></pre> <p>This avoids several problems:</p> <ul> <li>Gaps when Daylight Saving Time starts</li> <li>Duplication / Ambiguity when Daylight Saving Time stops</li> <li>Log files from different machines not aligning due to time zone settings</li> </ul> <p>Additionally, if these are <em>servers</em> you are talking about, you should also set the time zone of the machine to UTC. That way, other logs on the system will also match up at the same times, even if they are set to record local values.</p> <p>Also, be aware that Windows wants the computer bios to be set to local time, while Linux wants it at UTC. This can cause some interesting behaviors, especially with virtual machines, if multiple VMs are running with different operating systems or if host and guest OS are different. Setting the local time zone to UTC avoids this.</p> <p>Regarding the strange output of <code>DateTime.ToString()</code> in Mono - are you by chance running on a Raspberry Pi? This is a known bug. See <a href="https://stackoverflow.com/a/15342062/634824">this answer</a> and the issue linked from there.</p> <p>I am not sure why you are getting UTC values instead of local values from Log4Net's <code>LoggingEvent.TimeStamp</code>, since <a href="http://logging.apache.org/log4net/release/sdk/log4net.Core.LoggingEvent.TimeStamp.html" rel="nofollow noreferrer">these docs</a> say it is local. However, it is possible you are using an appender that sends the UTC timestamp instead. In <a href="http://logging.apache.org/log4net/release/faq.html#distributed" rel="nofollow noreferrer">the FAQ</a>, there is a question that talks about UTC transmitted by a <code>RemotingAppender</code>. You might be doing something similar. I don't know for sure, since you didn't show that part of your code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload