我正在使用 Windows azure 项目开发 Enterprise library 6。基于快速启动应用程序,我们可以将消息、事件记录到 XML 文件或 sql 服务器。以下代码在示例应用程序中执行此操作。
this.fileListener = FlatFileLog.CreateListener("aExpense.DataAccess.log", formatter: new XmlEventTextFormatter(EventTextFormatting.Indented), isAsync: true);
fileListener.EnableEvents(AExpenseEvents.Log, EventLevel.LogAlways, AExpenseEvents.Keywords.DataAccess);
//Log to Rolling file informational UI events only
this.rollingfileListener = RollingFlatFileLog.CreateListener("aExpense.UserInterface.log", rollSizeKB: 10, timestampPattern: "yyyy", rollFileExistsBehavior: RollFileExistsBehavior.Increment, rollInterval: RollInterval.Day, formatter: new JsonEventTextFormatter(EventTextFormatting.Indented), isAsync: true);
rollingfileListener.EnableEvents(AExpenseEvents.Log, EventLevel.Informational, AExpenseEvents.Keywords.UserInterface);
// Log all events to DB
this.dbListener = SqlDatabaseLog.CreateListener("aExpense", WebConfigurationManager.ConnectionStrings["Tracing"].ConnectionString, bufferingInterval: TimeSpan.FromSeconds(3), bufferingCount:10);
dbListener.EnableEvents(AExpenseEvents.Log, EventLevel.LogAlways, Keywords.All);
但我需要将所有这些事件和异常记录到 Azure 表存储。Enterprise Library 6 可以支持吗?怎么做 ?