To set the logging level at the command line you can enter in the appropriate command for your agent version. At the command line you can set the logging level for a certain duration or indefinitely. You can also manually set the logging level.

(info) NOTE: Setting it manually will set it indefinitely.

It can be helpful to have the logging set to FINEST/DEBUG during installation but it is recommended to have logging set to INFO during production.



Dynamically Setting the Logging Version

By default, the logging level of the Replicator agent is set at INFO. This setting incurs minimal logging and is a good candidate for every day use.

The logging level can be dynamically changed using the setLogging command. This command is useful during troubleshooting to obtain greater detail of the processing taking place. You may be asked to increase the logging level to finest by using the setLogging command.

The setLogging command has the following syntax:

setLogging LOGGING_LEVEL DURATION

The LOGGING_LEVEL argument is required and must be either finest, info, or debug.

The DURATION argument is used to specify how many seconds the change in logging level is to remain in affect. The default is one hour and by setting it to -1 it will remain indefinitely. Typically the logging level is changed to finest only during troubleshooting so the default value ensures that info level debugging is resumed after an hour.

For example you can call the following commands from the root Perspectium directory:

# Setting to finest logging for an hour
bin/setLogging finest
 
# Setting to finest logging for 3 hours (10800 seconds) 
bin/setLogging finest 10800
 
# Setting to info logging indefinitely
bin/setLogging info -1 

(info) NOTE: This is will stay in affect until the  DataSync Agent is restarted or the duration expires.



Manually Setting the Logging Level

You can manually set the logging level by editing a single line of the config. Log into the host that the Agent is installed on and navigate to the home directory of the Agent and edit the log4j2.xml file within the conf folder.

Change the property <Root level="debug"> to the desired logged level: info, debug, or finest.

By default the Agent is configured with info but like the setLogging command, can be changed to different levels to aid in troubleshooting. The levels are the same, with finest providing the most detail and info provides the least. Save the file and restart the agent to implement the change. This will stay in affect through Agent restarts until it is modified back. You can still modify the logging level through the previous bin/setLogging command above.



Additional Configurations

There are additional changes you can make to alter the logs specific to different databases and libraries used by the Agent to aid in troubleshooting. The file logging.properties within the conf folder contains information and examples for such changes.

Debugging Database IO MSSQL

For example to enable debugging logs for I/O through the JDBC of MSSQL you can append the following to the end of logging.properties.

com.microsoft.sqlserver.jdbc.level = FINEST


Can't find what you're looking for?  

See the FAQ or browse the Perspectium Community Forum.