Synergy Logging - Log4Net - Version 4.6.33 and earlier

This article is only relevant for Synergy 4.6.33 and earlier, as these versions of the application used Log4Net for logging.
 
For Synergy 4.6.34 and later, NLog is used instead. For documentation, please refer to the relevant article.
 
 
Synergy allows the logging of a variety of information from the main application itself, and installed components and services. This article will cover how to configure this logging.
 

Synergy Logging

Synergy can store logs on the server at a chosen level of detail. Logging is enabled automatically, and no further actions are required to have the default level (Error+) of logging running.
 
All logs are stored by default in:
    %Synergy Root%\data\logs\
 
The most recent logs from the core application are stored in:
    %Synergy Root%\data\logs\web.log
 
Any Services running in Synergy can also create logs. In this case, they will be stored in a separate log that is named for the Service.
 
With the default settings, the log will automatically be broken into 1MB files, with up to 10 of these backup logs stored. When a log beyond the 10th is created, the oldest backup log is removed.
 
 

Logging Configuration

Synergy uses the open source Log4Net library to handle its logging. Examples of alternative logging options (file per day, to SQL database, etc.) can be found on Log4Net's public website. The configuration for creating a new log file per day is under the RollingFileAppender section of this website.
 
Additionally, there is an SDK for detailed information on particular options or settings.
 
Whenever editing logging settings, it is recommended that a backup is taken of the file before editing it. This ensures that if something goes wrong the logging state can be reverted to normal simply by restoring the backup, and is a safer way to make temporary changes (for example to the logging level) than manually making and reverting changes within the file.
 
The Synergy Website, Application Pool, and services must be restarted after any changes to logging are made for them to take effect. This will cause a short downtime in the application and so is advisable to do outside of usage hours.

Logging Levels

The most common change likely to be made to logging is to alter the logging level. The level sets the minimum severity of an event required for it to be logged, running from entirely disabled to logging all events.
 
To change the logging level in one of the open configuration files, search within the file to find a line like this:
    <level value=”ERROR”/>
 
The ERROR section of this string declares the minimum severity of an event for it to be logged, selected from the following potential levels (in order of comprehensiveness):
  1. ALL
  2. DEBUG
  3. INFO
  4. WARN
  5. ERROR
  6. FATAL
  7. OFF
Typically, the level will be set to ERROR by default, meaning that it will only report errors and fatal conditions. If set to WARN, it would report both errors and fatal conditions as with ERROR, but also report potentially harmful situations. Further explanation of the different levels can be found in the relevant Log4Net documentation.
 
For most purposes, when asked to enable logging (unless specified otherwise) this means to set the level to ALL, thus harvesting all possible information to aid in troubleshooting efforts. However, do be aware that this will generate a significant load on the application, and it’s encouraged that you only set the level to ALL for brief durations while actively testing a problem!
 
Ideally, the program is setup and ready to run through the problem that prompted the need for troubleshooting, the logging level is set to ALL for that program briefly while the problem is reproduced, and then the logging level is returned to the previous setting upon completion.

Log File Retention

By default, Synergy logging is set to maintain the most recent 10 log files of 1 MB each. However, on production systems, this may only span a few minutes if the Logging Level has been set to DEBUG or ALL. For these cases it is advised to increase the retained total logs up to 100 MB or more to provide a greater time span of logs.
 
Each log file should not be set to go above 10MB.
 
Chnaging Log Retention is achieved by changing the 2 settings from their default values:
<maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" />
For 100MB total logs:
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
Or for greater , ie 500MB of log retention:
<maxSizeRollBackups value="50" />
<maximumFileSize value="10MB" />