NLog is an open-source and lightweight logging platform with rich log routing and management capabilities.
NLog is also easy to configure, it is extendable and supports a clean code-based configuration.
Main Advantages of NLog
- It is easy to configure.
- It improves performance by sending logs asynchronously - according to our testing, the performance improvement of a new installation and start-up of Coresuite is 22-25% (measured on SAP Business One 10.0 FP2102 - MSSQL).
- Log messages are much easier to read.
Important and Useful
- The path of the log file is changed from %temp% to %temp%/coresuite .
- The name changes from coresuiteDebugLog.xml to coresuite-%CompanyDBName%.log .
- Coresuite will create a new log file every day and the log file for the previous day will be archived in the same folder into a file with the name coresuite-%CompanyDBName%.Date.zip .
- We are using NLog version 4.7.9 in our code. If you are using NLog also in your custom modules, please use the same version to avoid conflicts between versions.
- If you are using Notepad++ for reading of logs, you can configure it as follows, which will differentiate various log events with colors, and thus improve the readability of the log.
- In Notepad++, click on Language → Define your language... :
- Click on Create New... and enter a name for the language:
- Switch to the Keywords Lists tab in field Ext. type "log" so it is applied to all *.log files and enter the words that should be marked up in text boxes:
- Choose the Styler button for each keyword to define text formatting, in our example the background color:
- Close the dialog boxes when finished.
- To apply the language onto the text in Notepad++, expand Language from the upper menu and choose the language created in the previous steps:
- An example of text (log file) with formatting applied:
The same approach can be applied to facilitate any other text file review using keyword highlighting.