2
我在我的应用程序中使用Logger类来捕获错误和记录事件。但在日志写入文本垫的时候,它返回一个例外,这样记录器错误问题
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)"
我写日志代码:
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);
}
为解决此问题,请帮助..
非常感谢罗布。我今天有同样的问题,我的日志路径有问题。 – 2013-10-28 08:07:48