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