NLog configuration file root node and nlog configuration file Node

Source: Internet
Author: User

NLog configuration file root node and nlog configuration file Node

NLog. cnfig configuration file information

<Nlog xmlns = "http://www.nlog-project.org/schemas/NLog.xsd" xmlns: xsi = http://www.w3.org/2001/XMLSchema-instance autoReload = "true" // automatically loaded throwExceptions = "true" // NLog log system throws an exception internalLogFile = "c: \ log \ nlog.txt "// NLog internal log file location internalLogLevel =" Debug "// log Level
> // Declare the variable syntax <variable name = "myvar" value = "myvalue"/>
Value can be used in Layout expressions, such as Layout <variable name = "logDirectory" value = "$ {basedir}/logs/$ {seasonal date}"/>

<Nlog>

AutoReload Automatic reconfiguration)

Once the program is started, after the NLog. config file is read, it is known that the program will not read the configuration file again after it is started. If we don't want to stop the program, for example, how can we say that the server stops. This configuration is used. The configuration function is that once you modify the configuration file, the program will re-read the configuration file, that is, automatically re-configure.

Troubleshooting logging)

<Nlog throwExceptions = "true"/>

<Nlog internalLogFile = "c: \ log \ nlog.txt"/>-Setting the internalLogFile attribute allows NLog to write internal debugging and exception information to the specified file.

<Nlog internalLogLevel = "Trace | Debug | Info | Warn | Error | Fatal"/>-determines the level of internal logs. The higher the level, the simpler the output log information. InternalLogLevel = "Off" Disabled

<Nlog internalLogToConsole = "false | true"/>-whether to output internal logs to the standard console.

<Nlog internalLogToConsoleError = "false | true"/>-whether to output internal logs to the stderr console ).

Setting the throwExceptions attribute to "true" can prevent NLog from blocking such exceptions, but throw them to the caller. This can help us quickly locate problems during deployment. Once the application has been correctly configured, we recommend that you set the throwExceptions value to "false" so that the application will not crash due to log issues.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.