I used Logger class in my application for catching the error and logging events. But at the time of writing the log to the text pad, it returns one exception like this
Microsoft.Practices.ObjectBuilder2.BuildFailedException was unhandled by user code
Message="The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, null]) failed: The device is not ready.\r\n (Strategy type ConfiguredObjectStrategy, index 2)"
My code for writing the log is:
public static void Log(string Message)
{
LogEntry log = new LogEntry();
log.TimeStamp = DateTime.Now;
log.Title = "Exception Logging";
log.Categories.Add("Category");
log.Message = Message.ToString();
Logger.Write(log);
}
Please help for resolving this issue..