Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Logging 将事件日志条目保存到Windows Azure存储_Logging_Configuration_Azure_Event Log_System.diagnostics - Fatal编程技术网

Logging 将事件日志条目保存到Windows Azure存储

Logging 将事件日志条目保存到Windows Azure存储,logging,configuration,azure,event-log,system.diagnostics,Logging,Configuration,Azure,Event Log,System.diagnostics,我有一个应用程序,它使用System.Diagnostics.Trace和System.Diagnostics.EventLog类来生成应用程序的日志信息 我知道可以将Azure角色配置为自动将System.Diagnostics.Trace存储的信息保存到Azure存储中 我想知道我是否可以做些什么来获得与System.Diagnostics.EventLog相同的行为(更改Azure角色中的一些配置,并将EventLog数据存储到Azure存储中) 实际上,没有任何东西会自动保存在存储器中。

我有一个应用程序,它使用System.Diagnostics.Trace和System.Diagnostics.EventLog类来生成应用程序的日志信息

我知道可以将Azure角色配置为自动将System.Diagnostics.Trace存储的信息保存到Azure存储中

我想知道我是否可以做些什么来获得与System.Diagnostics.EventLog相同的行为(更改Azure角色中的一些配置,并将EventLog数据存储到Azure存储中)


实际上,没有任何东西会自动保存在存储器中。信息被缓冲到磁盘上的角色中,然后(按需或按计划)传输到存储器。因此,您完全可以对事件日志执行相同的操作。您只需像正常情况一样使用它们,将诊断配置为监视它们,并偶尔传输到存储。使用Windows Azure MMC作为免费工具可以轻松完成此操作。

实际上,存储中不会自动保存任何内容。信息被缓冲到磁盘上的角色中,然后(按需或按计划)传输到存储器。因此,您完全可以对事件日志执行相同的操作。您只需像正常情况一样使用它们,将诊断配置为监视它们,并偶尔传输到存储。使用Windows Azure MMC作为免费工具可以轻松完成此操作。

对于诊断跟踪,您需要:

  • 使用web.config中的诊断跟踪侦听器
    Microsoft.WindowsAzure.diagnostics.DiagnosticMonitorTraceListener
  • 确保已设置
    日志.ScheduledTransferPeriod

对于事件日志跟踪,您需要配置诊断以跟踪应用程序事件日志:

config.WindowsEventLog.DataSources.Add(“Application!*”);
// can also add System if you want to: config.WindowsEventLog.DataSources.Add(“System!*”);
config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(5);


有关诊断跟踪的完整说明,请参见

,您需要:

  • 使用web.config中的诊断跟踪侦听器
    Microsoft.WindowsAzure.diagnostics.DiagnosticMonitorTraceListener
  • 确保已设置
    日志.ScheduledTransferPeriod

对于事件日志跟踪,您需要配置诊断以跟踪应用程序事件日志:

config.WindowsEventLog.DataSources.Add(“Application!*”);
// can also add System if you want to: config.WindowsEventLog.DataSources.Add(“System!*”);
config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(5);


有关详细说明,请参见

嗨,斯图尔特,谢谢你的回答。问题是,这些步骤将帮助我保存System.Diagnostics.Trace保存的信息,我已经知道如何保存这些信息。我需要的是类似的东西,但用于System.Diagnostics.EventLog类。啊-抱歉!这些条目会写入windows中的应用程序事件日志-也添加了关于这些的评论。嗨,斯图尔特,谢谢你的回答。问题是,这些步骤将帮助我保存System.Diagnostics.Trace保存的信息,我已经知道如何保存这些信息。我需要的是类似的东西,但用于System.Diagnostics.EventLog类。啊-抱歉!这些条目会写入windows中的应用程序事件日志-也添加了有关这些的注释。