【问题标题】:How to create database for a Semantic Logging Application Block with SqlDatabaseSink如何使用 SqlDatabaseSink 为语义日志记录应用程序块创建数据库
【发布时间】:2014-10-28 11:01:28
【问题描述】:

如何为语义日志记录设置 SQL Server 数据库。 是否需要提前创建记录信息的表? 如果是,要使用的架构是什么。

我有以下代码:

var listener = new ObservableEventListener();
string connectionString = @"Data Source=nibc2025;Initial Catalog=TreeDataBase;Integrated Security=True;User Id=sa;Password=nous@123";

listener.EnableEvents(AuditingEventSource.Log, EventLevel.LogAlways, Keywords.All);
databaseSubscription = listener.LogToSqlDatabase
(
    "Test",
    connectionString,
    "Traces",
    Buffering.DefaultBufferingInterval,
    1,
    Timeout.InfiniteTimeSpan, 500
);

// The following one line of code is not part of this function.
// It is just added here to show this is how I log my information.
// Inside LogInformation method I call the 'Write' method
AuditingEventSource.Log.LogInformation("sgsgg", "sgsg");

databaseSubscription.Sink.FlushAsync().Wait();

【问题讨论】:

  • 好的。我得到了它。该脚本位于包文件夹中。我忽略了这一点。
  • 你能告诉我具体在哪里

标签: application-blocks logging-application-block semantic-logging


【解决方案1】:

好吧,由于这个帖子在 Google 上获得最多关于语义登录到 SQL DB 甚至 SLAB 的点击...

创建数据库的脚本在这里

\packages\EnterpriseLibrary.SemanticLogging.Database.1.0.1304.0\scripts

为了创建 EventSource 和 Fire the Blocks,这里提供了信息,用于快捷方式和快速修复解决方案

http://entlib.codeplex.com/discussions/540723

问候,

【讨论】:

    【解决方案2】:

    好的。我得到了它。该脚本位于包文件夹中。我忽略了这一点。

    【讨论】:

    • 你能告诉我具体在哪里
    • 包文件夹中隐藏的实际代码在哪里,请同时提供该信息。
    猜你喜欢
    • 1970-01-01
    • 2015-01-10
    • 2014-04-30
    • 2016-07-19
    • 2014-10-13
    • 2013-08-01
    • 1970-01-01
    • 2012-09-24
    • 1970-01-01
    相关资源
    最近更新 更多