I'm using RollingFile log from Enterprise Library and I'm configuring it by this way:
var builder = new ConfigurationSourceBuilder();
builder.ConfigureLogging()
.LogToCategoryNamed("General")
.WithOptions.SetAsDefaultCategory()
.SendTo.RollingFile("Log File")
.RollEvery(Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollInterval.Day)
.UseTimeStampPattern("yyyyMMdd")
.WhenRollFileExists(Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollFileExistsBehavior.Overwrite)
.FormatWith(new FormatterBuilder()
.TextFormatterNamed("Text Formatter")
.UsingTemplate("{message}"))
.ToFile(SettingsHelper.LogFilePath)
.WithHeader(string.Empty)
.WithFooter(string.Empty);
var configSource = new DictionaryConfigurationSource();
builder.UpdateConfigurationWithReplace(configSource);
EnterpriseLibraryContainer.Current = EnterpriseLibraryContainer.CreateDefaultContainer(configSource);
My problem is:
The log must be one file per day, ok, it is done. But when I open the log file of date 04/21/2016 for example, the content is of date 04/20/2016. Why is this happen? Is something wrong in the configuration?