Enable FlexNet Publisher Debug Logs

This section describes how to enable FlexNet Publisher debug logs. It is crucial to understand the differences found in the debug log based upon the enable method. These differences will dictate how Monitor will be configured to import data from the logs.

To enable the debug log in FlexNet Publisher, use one of the following methods.

Static Debug Log

A static debug log is one that captures both the lmgrd and vendor daemon output. The lmgrd daemon contributes date stamps, while the vendor daemon contributes all license activity.

At license server startup time, pass the -l </path/to/debug/log> option to lmgrd. This will create a debug log that will contain all of the information necessary for Monitor to properly analyze the log contents. However, this file is not rotatable, and will require a restart of the server to rotate the log. This type of log will grow over time, the rate at which is determined by the amount of activity on the license server. If disk space is a concern, the rotating method below should be considered.

Rotating Debug Log

A rotating debug log is one that captures only the vendor daemon output, which means there will be no date stamps in the file. Because of this, there is a chance for inaccurate assumptions in the log. For example, if license activity ceases for more than 24 hours, the day will become unknown due to there not being a visible roll-over at midnight. To address this, the log must be rotated daily, typically a few minutes after midnight.
  • In the options file for FlexNet Publisher, use the DEBUGLOG </path/to/debug/log> directive. So that Monitor can appropriately handle FlexNet Publisher server restarts, the debug log name specified in this directive must be in the format of <file>.startup. This will indicate that a restart has occurred.
  • In a triad environment, the DEBUGLOG directive may specify the same physical file since the MASTER server in the triad is the only one that writes to the log file at any given time. The log files may also be kept separate for each server as long as they are all specified in the Monitor configuration.
In this method, the debug log must be rotated daily. This will ensure that the license activity in the log is always for the current 24-hour period and will also keep the file size small. Monitor will need to be configured to automatically look for a daily log file. For this to work properly, the debug log must be rotated to a file with a name reflecting the current date, in the format of <fileName>.<YYYYMMDD>, using the lmswitch command in conjunction with a task scheduling facility.
For UNIX, use cron
Example cron task:
# FlexNet Publisher debug log cron tasks for Monitor.
# Make sure to keep each cron job on one line and either use full paths for each file
# or change into the directory where the file exists.
# To suppress cron mail from being sent, add > /dev/null 2>&1 after each command.
## If the server is restarted for any reason, switch the debug log to the current day
# so it can be parsed, then remove the startup log.
* * * * * [ -f debug.startup ] &&   lmswitch -c license.dat vendord debug.`date +\%Y\%m\%d`.log && rm -f 
## Rotate the log every night at midnight
0 0 * * * lmswitch -c license.dat vendord debug.`date +%Y%m%d`.log
Using cron is the most reliable approach to performing the rotation successfully. The first cron task will detect if a FlexNet Publisher server restart has occurred via the presence of the .startup debug log. If this log exists, the debug log will be switched to the standard .YYYYMMDD log name format, which is automatically parsed by Monitor. This task runs every minute so that gaps in the data collection are kept at a minimum. The second task will switch the log file every night at midnight to a name that matches the current day, leaving the previous day's log behind for archive purposes.
For Windows, use the Task Scheduler:
To perform rotation on Windows, the Task Scheduler application must be used in conjunction with a batch script as follows:
  • Use the following example to create a batch script (modify the rotation time to the desired time).
  • Create a scheduled task in Task Scheduler by pointing to the batch script and selecting it as the application to run. Set it to run every day.
  • After the task is created, open the Advanced Properties for the task and set it to repeat every one minute. The batch script itself will make sure the appropriate action is taken at the right time.
Example batch file:
@echo off

REM FlexNet Publisher debug log rotation script for Monitor.
REM Make sure to use full paths for each file or change
REM into the directory where the file exists.

REM Define rotation time (24-hour clock)
set rotate=00:00

REM Get today in YYYY/MM/DD format
set today=%date:~10,4%%date:~4,2%%date:~7,2%

REM Get time in HH:MM format
set now=%time:~0,5%

REM If the debug.startup is present, the server has been restarted
REM and the log should be renamed so Monitor will parse it
if exist debug.startup goto STARTUP

REM If the script is called at the rotation time, perform the rotation
if %now% == %rotate% goto ROTATE
goto DONE

lmswitch -c license.dat vendord debug.%today%.log
del debug.startup
goto DONE

lmswitch -c license.dat vendord debug.%today%.log
goto DONE


Once the debug log has been configured and is being generated by the license manager, Monitor must be configured to parse the log. This can be done jointly with a sampling monitor, or a debug log can be monitored in a stand-alone fashion.