简体   繁体   English

使用进程内的语义记录应用程序块的配置文件

[英]Config File for Semantic Logging Application Block using in-process

I am using Semantic Logging Application Block (SLAB) for in-process logging in C# language. 我正在使用语义记录应用程序块(SLAB)进行C#语言的进程内日志记录。 My requirement states that i should be able to change the EventLevel of the listener without having to re-compile the Code:- 我的要求声明我应该能够更改侦听器的EventLevel而无需重新编译代码: -

Eg:- 例如:-

var listener1 = new ObservableEventListener();
listener1.EnableEvents(RepositoryLog.Log, EventLevel.Verbose);
listener1.LogToConsole();

After having searched the internet i only found that you need a config file to do that. 搜索完互联网后,我发现你需要一个配置文件才能做到这一点。 But since it is an in-process logging, SLAB does not provide any in-built Config File. 但由于它是进程内日志记录,因此SLAB不提供任何内置的配置文件。 So i want a way through which i can achieve the requirement, either by creating a Config file or else by any other way. 所以我希望通过创建配置文件或其他任何方式来实现要求。

It is explicitly stated that with in-process SLAB, all configuration is performed in code, while when using the SLAB out-of-process, all configuration is performed in an xml config file. 明确声明,使用进程内SLAB,所有配置都在代码中执行,而在使用SLAB进程外时,所有配置都在xml配置文件中执行。 So, what you need is not supported out of the box and you can only do it by writing all the plumbing yourself, an example of which I am yet to encounter. 所以,你需要的东西不是开箱即用的,你只能通过自己编写所有的管道来实现,这是我尚未遇到的一个例子。 It is obvious that SLAB is primarily meant to be used out-of-process so it can use Event Tracing for Windows infrastructure (which it won't do if you use it in-process). 很明显,SLAB主要用于进程外,因此它可以使用Windows基础结构的事件跟踪(如果您在进程中使用它将无法执行)。 However, the last docs I encountered state that the out-of-process SLAB is not yet considered production-ready... quite strange from Microsoft. 但是,我遇到的最后一个文档表明,进程外SLAB还没有被认为是生产就绪......微软很奇怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用语义日志记录应用程序块(SLAB)基于C#中的级别配置多个接收器(进程内) - How to use Semantic Logging Application Block (SLAB) to configure multiple sinks based on level in C# (in-process) 使用ETW和语义记录应用程序块的文件锁 - File locks using ETW and Semantic Logging Application Block 语义应用程序日志记录块 - 在asp.net应用程序中登录控制台 - Semantic Application Logging Block - Console logging in asp.net application 记录应用程序块未记录到文件 - Logging Application Block not logging to a file 如何组织语义记录应用程序块的EventSource? - How can I organize EventSources for the Semantic Logging Application Block? 如何在语义记录应用程序块中更改事件的消息 - How does one change a message for an event in Semantic Logging Application Block EntLib5:记录应用程序块,通过代码而不是配置文件进行配置? - EntLib5: Logging application block , configuring via code instead of a config file? 如何使用 FluentMigrator v3.2.15 In-Process runner 将 output 直接记录到文件中? - How do I direct log output to a file, using a FluentMigrator v3.2.15 In-Process runner? 记录应用程序块 - 记录调用者 - Logging Application Block - Logging the caller 记录应用程序块 - Logging Application Block
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM