Code Coverage by Clover.NET

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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by Ron Grabowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
https://lists.sourceforge.net/lists/listinfo/nlog-list

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

by lewap :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
LightInTheBox - Buy quality products at wholesale price