SafeNet Synchronization Agent log files
The SafeNet Synchronization Agent log file records information pertinent to the service.
You can also view transaction and synchronization details.
Configure the log level
To configure the level of detail that is displayed in SafeNet Synchronization Agent log files:
-
From an administrator account on a Windows computer, launch SafeNet Synchronization Agent by selecting Start > SafeNet > Agents > Sync Agent. If necessary, right-click Sync Agent and select Run as administrator.
-
Select File > Log Level and choose from the following options:
-
Off—Do not display log files.
-
Error—Display only error messages.
-
Warning—Display error and warning messages.
-
Info—Display error, warning, and info messages.
-
Debug—Display error, warning, info, and debug messages.
-
Trace—Enhanced debug logging in special circumstances.
-
Configure the log file location
The default location for SafeNet Synchronization Agent log files is C:\Program Files\CRYPTOCard\BlackShield ID\sasLog. To change the location into which STA or SAS PCE saves SafeNet Synchronization Agent log files:
-
Navigate to the Log4Net file placed at the default path, C:\Program Files\CRYPTOCard\BlackShield ID\SasConfigs.
-
As Administrator, within the <log4net debug section of the code, make the following edits to the file:
-
Add an appender, for example: <appender name=“RollingFile”.
-
Define the log file destination, for example, <file value=“D:\SyncAgent\Log\”/>.
-
Add an appender-ref (for example, <appender-ref ref=“RollingFile”/> to <root>.
-
-
Select Save.
Each ‘appender name’ must be unique and accompanied by a matching ‘appender-ref’. For additional information about Apache log4net™ appenders, see https://logging.apache.org/log4net/release/config-examples.html.
Example
Configure rolling backups
You can configure SafeNet Synchronization Agent to save a maximum number of log files and then delete the oldest log file each time a new log file is created.
For example, to maintain a rolling backup of the 10 most recent log files (maximum size = 100 KB) each day:
-
Navigate to the Log4Net file placed at the default path, C:\Program Files\CRYPTOCard\BlackShield ID\SasConfigs.
-
As Administrator, within the <log4net debug section of the code, make the following edits to the file:
-
Add an appender, for example: appender name=“RollingLogFileAppender”.
-
Set the following values:
– rollingStyle value="Composite" (This value enables you to combine Date and Size parameters.)
– datePattern = "yyyy-MM-dd" (This value will roll the backup log file every day.)
– maxSizeRollBackups = "10" (The maximum number of backup files that are kept. After this number is reached, the oldest backup file is erased when the next backup file is created.)
– maximumFileSize value="100KB" (Recommended)
-
Add an appender-ref (for example, <appender-ref ref=“RollingLogFileAppender”/> to <root>.
-
-
Select Save.
It is important that you select a datePattern that meets your requirements. For example, if the datePattern includes the time (yyyy-MM-dd HH:mm) and maxSizeRollbackups = 10, then SafeNet Synchronization Agent will maintain a rolling backup of the 10 most recent log files every minute.
Example
This example shows how to configure SafeNet Synchronization Agent to save the 10 most recent log files, of up to 100 KB each, every day.
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logfile" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="yyyyMMdd" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
Configure UdpAppenders
You can configure SafeNet Synchronization Agent to send logging events to a remote host as connectionless UDP datagrams.
For example, to configure UdpAppender to send events to a remoteAddress on a specific remotePort:
-
Navigate to C:\Program Files\CRYPTOCard\BlackShield ID\SasConfigs\Log4Net.config.
-
As Administrator, make the following edits to the file:
-
Add an appender, for example: appender name=“UdpAppender”.
-
Set the following values:
– remoteAddress value="22.0.86.188" (Use the IP address of your external remote host.)
– remotePort value="549" (Use the listening port for your remote host endpoint.)
– layout type="log4net.Layout.PatternLayout" and value="%utcdate{HH:mm:ss,fff} {%thread} [%level] %logger %message" (Use the value you require.)
-
-
Add an appender-ref (for example, <appender-ref ref=“UdpAppender”/>) to <root>.
-
Select SAVE.
Example
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
<remoteAddress value="224.0.0.1" />
<remotePort value="8080" />
<layout type="log4net.Layout.PatternLayout" value="%-5level %logger [%ndc] - %message%newline" />
</appender>