For security reasons, we are not allowed to have our log4net use any external config files (like app.config), so everything has to be coded internally.
We are using log4net to write logs to an SQLite database. Our date parameter looks like this:
adoNetAppender.AddParameter(new AdoNetAppenderParameter
{
ParameterName = @"@date",
DbType = DbType.DateTime,
Layout = new RawUtcTimeStampLayout(),
});
Everything looked fine on this side of the pond, but many Australian users were seeing "Invalid Date" on every entry.
Figuring that it might be a timezone issue, I converted the event's timestamp to universal time, which I was hoping would fix the problem but we are still seeing it.
public virtual object Format(LoggingEvent loggingEvent)
{
return loggingEvent.TimeStamp.ToUniversalTime();
}
Is there something we need to set internally for log4net to get a valid date, or is there something else that can be done to format it better? I am handicapped by the fact that it can't be reproduced here, no matter if we set our machines to Australian time or use various VMs to attempt to reconstruct the error.