The_Chud
The_Chud

Reputation: 1091

merge or combine App.config with Nlog.config Log4View

I'm building a winforms application, and am using NLog as my logging framework. My configuration for NLog resides in its own file, NLog.config and this is in the main program directory. So App.config and NLog.config sit in the same directory.

The logging itself all works OK. The problem I am having is when I am using the Log4View program (a commercial log viewer). I can "drag"my application exe into the main form of the Log4View application and it automatically detects my NLog configuation. Now, the pickle is this:

This only works when I have my NLog configuation block:

<nlog tags
           targets
           rules etc

In the App.config file itself.

When I move the NLog configuration into its own file, this no longer works as the <nlog /> configuation block is no longer present in the app.config file.

So, How do I "include" the NLog.config in the app.config without including the whole contents of the NLog.config file.

I have tried:

configSource="NLog.config"
<include file="NLog.config">

and messing around with

So to all the SO'ers out there - Is there are way to achieve this?

Something like: <nlog File="NLog.config" /> - which will still include the nlog configuration block tag that i require, however it includes the contents of my file automatically?

Thank you!

Chud

Upvotes: 1

Views: 434

Answers (0)

Related Questions