Configure Logging Levels With NLog

In IT Asset Management, log files are generated by the NLog logging platform for the beacon.

Note:The NLog logging platform does not apply to the agent.

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

It's common for customers to change the log level value in a configuration file. The highest log level value is FATAL, followed by ERROR, WARN, INFO, DEBUG and the lowest log level value TRACE. When a particular log level is set in a config file, higher log levels will also display. For example, on setting the INFO log level, the FATAL, ERROR and WARN log levels will also display.

This determines the log type. For example, INFO will provide informational messages in the log files.

Some customers may also change the MaxAgeDays value (default = 30) to 90 (this value determines how many days the logs will be kept for). Some log files have configuration settings for how large the log file is allowed to become before it's deleted (10mb, 50mb).

The default base directory containing NLog configuration files for IT Asset Management is C:\ProgramData\Flexera Software\Compliance\Logging\. Generated log files are saved to the same location.

This base directory may be overridden by setting the registry entry HKLM\SOFTWARE\WOW6432Node\ManageSoft Corp\ManageSoft\Compliance\CurrentVersion\LoggingBaseDirectory.

Each configuration file is an XML document containing NLog configuration options. The logging level can be edited using a text editor. For example, see the beacon NLog configuration file below.

The 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>

To change the logging level value, two different levels towards the end of the config file can be configured (<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. There are six levels:

Logging levels

Logigng level

Details

INFO

Informational messages

ERROR

Error messages

WARN

Warnings which don't appear to the user of the application

DEBUG

Less detailed and/or less frequent debugging messages

TRACE

Very detailed log messages, potentially of a high frequency and volume

FATAL

Fatal error messages. After a fatal error, the application usually terminates

Configuring logging for the beacon server

The following table provides default logging configuration details for various beacon server components and subsystems.

Default logging configuration details

Component / Subsystem

Location under C:\ProgramData\Flexera Software\Compliance\Logging

Active Directory import

This log captures the execution of Active Directory imports which are configured on the 'Active Directory Imports' page in the Beacon UI. This log captures the LDAP connection being established with the domain controller and the import of Active Directory information. The import produces an .actdir file which is uploaded to the inventory server.

ActiveDirectoryImport\ADImport.log

Beacon engine service

This log captures events from the Beacon Engine Service. This is one of the main log files on a beacon server and captures information about a lot of the background activities performed by a beacon. An example of some of the main events that are captured include; downloading and loading beacon policy, downloading updates to discovery & inventory rules, download discovery export file, downloading updated importer XML files.

BeaconEngine\BeaconEngine.log

Beacon IIS app

Captures events from the beacon's web server component. The beacon web server generates and serves agent policy, settings, and upgrade files and accepts incoming files from agents.

BeaconIIS\BeaconIIS.log

Compliance Reader logs

Captures events from compliance reader imports reading data from external systems. To see the configured imports on a beacon you can look at the 'Inventory systems' page in the Beacon UI.

ComplianceReader\importer-[ddmmyyyy]-[pid].log

Compliance upload

Logs events about the upload of inventory extracted from external databases and business adapter data. ComplianceUpload.exe is launched by the 'Upload third party inventory data' scheduled task.

This process does not include the upload of files received from FlexNet inventory agents (such as inventory .ndi files and others).

ComplianceUpload\upload.log

Discovery and inventory rules

Logs events from the execution of Discovery & Inventory rules. You can see the configured rules in the Beacon UI on the 'Rules' page. Each rule execution will generate a new GUID (the task's unique SessionUID) which is used in the directory path when storing the log files.

Tip: When troubleshooting, sort the InventoryRule logging folder by the last modified date to find the most recently created folder after triggering rule execution manually in the Beacon UI.

InventoryRule\<GUID>\*.log

Inventory Beacon UI and processes

Captures events from the Beacon UI and various other tasks performed by the local inventory beacon. The BeaconEngine.log will generally be the main log to look at when troubleshooting a beacon but it's worth checking this too.

InventoryBeacon\inventorybeacon.log