NLog Config in separate file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NLog Config in separate file

Marek
Hi Support Team,

I'm trying to "drag" my .exe into the Log4View application so It can automatically detect my NLog targets. This works fine if my configuration is embedded directly into the app.config

However, I am trying to keep my NLog configuration in its own separate file (NLog.config)

I have added the following into my app.config to try to make this work:

Under <configSections> I have:

<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />

and I have the nlog configuration block as the following:

 <nlog configSource="NLog.config" />

When I drag my .exe into the Log4View program, I get :

"The selected application has no log appenders configured, which can be read by Log4View.
Log4View can use appenders which:
-are of type (Rolling)FileAppender, UdpAppender or TcpAppender;
-use XML or pattern layout
Other layouts cannot be parsed by Log4View"

How can i achieve dropping the .exe into Log4View, have the whole NLog config in its own
file, yet linked through app.config?

Regards,

Marek
Reply | Threaded
Open this post in threaded view
|

Re: NLog Config in separate file

Philipp Lauchner
Administrator
Dear Marek,

I am afraid this specific scenario is not supported by Log4View at the moment. When you drag an .exe into Log4View, it tries to find a config file with the same filename, but with an .config extension.
This config file is then scanned for appenders, but links to other confifg files are not resolved at the moment.

Yet this seems like a nice feature to have, we added this functionality on our to-do list for the next releases. In the meantime you can eighter drag your separate NLog config file into Log4View, drag your logfile into Log4View (in case you are using file based appenders) or configure a receiver by hand (e.g. for network appenders).

Thank you for your input!

Philipp Lauchner
PROSA GmbH  
Development & Support