[英]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.