專案週期緊湊導致延遲發布,請見諒。上篇較簡單,後續會補充。
支援將事件記錄至多種目標:
應用程式需適當格式化並記錄事件(本地或網路),有時需整合多來源事件。區塊透過收集常見任務、抽象提供者簡化開發,組態驅動讓基礎 Sink/Formatter 可熱插拔。
Message(必要)Category(預設 General)Priority(預設 -1)EventID(預設 -1)Severity(預設 Unspecified)Title(預設空字串)

copy "$(ProjectDir)\*.config" "$(TargetDir)"
// 參考
Microsoft.Practices.EnterpriseLibrary.Logging.dll
using Microsoft.Practices.EnterpriseLibrary.Logging;
public struct Priority
{
public const int Lowest = 0, Low = 1, Normal = 2, High = 3, Highest = 4;
}
public struct Category
{
public const string General = "General", Trace = "Trace";
}
LogEntry log = new LogEntry();
log.Message = this.txt_LogMessage.Text;
log.Category = Category.General;
log.Priority = Priority.Normal;
Logger.Write(log);

入門篇完成基本記錄。進階篇將介紹字典日誌、活動追蹤、過濾、格式客製化、同步/非同步設定等。