How do I tell NLog to load its configuration from a specific file?

2 messages Options
Embed this post
Permalink
Ron Grabowski

How do I tell NLog to load its configuration from a specific file?

Reply Threaded More More options
Print post
Permalink
How do I tell NLog to load its configuration from a specific file? I looked in NLog.Config namespace expecting to find something like this:

LogManager.Configuration =
 new LoggingConfiguration(new FileInfo("c:\\configFile.nlog"));

I'm assuming there's some way of loading the file and telling NLog to monitor it for changes and to tell NLog to load the file and not monitor it for changes.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
lewap

Re: How do I tell NLog to load its configuration from a specific file?

Reply Threaded More More options
Print post
Permalink
for configuration NLog from a specific file:
LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration("configFile.nlog");

to monitor it for changes you add:
<nlog autoReload="true" />

Ron Grabowski wrote:
How do I tell NLog to load its configuration from a specific file? I looked in NLog.Config namespace expecting to find something like this:

LogManager.Configuration =
 new LoggingConfiguration(new FileInfo("c:\\configFile.nlog"));

I'm assuming there's some way of loading the file and telling NLog to monitor it for changes and to tell NLog to load the file and not monitor it for changes.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nlog-list mailing list
Nlog-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nlog-list