We have many assemblies (class libraries) which our main application uses. I want to route the logs of some assemblies to different destinations, but I have one App.Config file, so how may I achieve this? I’m pretty much sure there is a setting like this in Logging Application Block which I’m unaware of. Also I want to route logs based on their priority (whether they should be logged or not) for each assembly which I’m doing logging.
Share
I found the solution. What I did is that for each assembly a created a category and a trace listener. And I used the main executable’s app.config file and the other assemblies are working fine.
Considering the log level, its already there in Logging Application Block, you can handle that with the SourceLevels property of the Category Sources or the Filter property of the Trace Listeners. The difference between both is in scope.
From patterns & practices’s discussion forum: