we encounter a weird problem with logging. We are using Microsoft.Practices.EnterpriseLibrary.Logging library for logging in our web application and the problem is that it writes the log with 1 hour difference from the current system time.
Our logger is based on this article and the time in a log entry is never set in code by us.
Every log entry has a title which looks like this:
MainLogSource Information: 0 : Timestamp: 11/04/2011 10:15:32 so this timestamp always 1 hour earlier than system time (e.g. this entry appeared at 11:15).
Where can be the problem?
Thanks
By default Enterprise Library logs using UTC timestamp, so these are unaffected by daylight savings time.
You can change the formatter in the .config file to use local time (see attached question), but be aware that this will result in duplicate entries when daylight savings time changes occur.
Enterprise Library 5.0 – Application Logging – Incorrect DateTime