NLog has replaced Log4net for configuring logging levels in IT Asset Management

Note:This enhancement is available with IT Asset Management.

From this release, the log4net assembly is no longer shipped with IT Asset Management, and has been replaced by NLog.

NLog is a logging platform that writes to several different targets (database, file, console) and allows users to change logging configuration on an ad hoc basis. For more information about NLog, visit the NLog website.

Note:The NLog upgrade impacts the logs that are generated on the beacon only, and not the agent. No logging changes have been made to the agent. Customers do not need to perform any new actions concerning this upgrade. Logging configuration is still changed by means of the XML config files in the default location C:\ProgramData\Flexera Software\Compliance\Logging, and the log files themselves will look identical to log files generated from previous IT Asset Management releases.

An example of the upgraded beacon NLog configuration file:

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

autoReload="true">

<extensions>

<add assembly="Flexera.Common.Logging"/>

</extensions>

<!-- the targets to write to -->

<targets>

<!-- write logs to file -->

<target xsi:type="Console" name="console" layout="[${date:format=yyyy-MM-dd HH\:mm\:ss.fff}] [${level:padding=-5:fixedLength=true:uppercase=true}] ${message:exceptionSeparator=\r\n:withException=true}" />

<target xsi:type="File" name="file" maxArchiveFiles="1000" archiveNumbering="Date" filename="${gdc:item=ComplianceLoggingPath:whenEmpty=${baseDir}}/InventoryBeacon/inventorybeacon.log"

archiveEvery="Day" archiveDateFormat="yyyy-MM-dd" layout="${date:format=yyyy-MM-dd HH\:mm\:ss,fff} [${logger:padding=-22:fixedLength=true}] [${level:padding=-5:fixedLength=true:uppercase=true}] ${message:exceptionSeparator=\r\n:withException=true}" />

</targets>

<rules>

<logger name="*" minlevel="Info" writeTo="file" />

<logger name="*" minlevel="Info" writeTo="console" />

</rules>

</nlog>

In the new NLog configuration file, for customers who want to change the level value for the logging, they can now do so by configuring two different levels towards the end of the configuration file (<logger name="*" minlevel="Info" writeTo="file" /> and <logger name="*" minlevel="Info" writeTo="console" />). One level outputs to a file and the other logs to the console. The six levels remain the same as they were for log4net - FATAL, ERROR, WARN, INFO, DEBUG and TRACE.

For more information on how NLog works with IT Asset Management, see Configure logging levels with NLog.

For information on configuring NLog advanced settings, visit the Configuration options page on the NLog website.