Home Forums Support Using NLog.config

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #894
    Anonymous
    Inactive

    Hello all!

    Is there a way to use nlog.config/app.config instead of defining the logging configuration in the sourcecode?

    #896
    Anonymous
    Inactive

    Heya Namikon,

    Many thanks for your interest in our library and welcome to our forums.

    In answer to your question, yes absolutely. In your application use the following syntax:

    string logFileName = "nlog.config";
    if(System.IO.File.Exists(logFileName))
        NetworkComms.EnableLogging(new NLog.Config.XmlLoggingConfiguration(logFileName));

    I will update the logging tutorial to include this example.

    Kind regards,
    Marc

    #902
    Anonymous
    Inactive

    Awesome, thanks a lot!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.