Skip to main content
Skip table of contents

Enhanced logging for Db2 Plugin

DB2 plugin v3.x

This feature adds three options to provide enhanced logging:

  1. To set debug log levels

  2. To set log retention levels

  3. To set trace size limit

Each host (added as an environment to DE) will have its own property file <Toolkit directory>/DB2/plugin-logging.properties. Delphix users can modify the parameters within this property file to configure the logging mechanism.

Setting debug log levels

Delphix users can set log levels for plugin generated logs by setting the parameter level. Higher logging levels will help to expedite debugging issues. There are three levels of logging which are: Level 1 (info), Level 2 (debug) and Level 3 (trace). All the objects (both dSources and VDBs) present on a staging/target host will refer to a single property file. For example; if we have 4 dSources on a host associated with a Delphix Engine then the log level applies to all the dSources.

Log level description:

  • level=1: This level will print only informational logs.

  • level=2: This level will print informational logs and debug statements. This is the default log level.

  • level=3: Besides informational and debug logs, this level will enable the traces. 

Setting log retention levels

Delphix users can set a retention level for diag logs (.diag.log)="" using="" parameter="">retention in the file. As per this parameter, the log files are moved (archived), renamed or deleted once they are too old or too big. New incoming log data is directed into a new fresh file (at the same location).

By default, this value will be set to a minimum value of 2. The user can change this value and set its value within the range 2 and 50. For example; if retention is set to 4, the plugin will have the following log files: <DB Name>.diag.log, <DB Name>.diag.log.1, <DB Name>.diag.log.2, <DB Name>.diag.log.3, <DB Name>.diag.log.4. 

  • File <DB Name>.diag.log is  the active log file.

  • File <DB Name>.diag.log.1 is the most recent archive log file

  • File <DB Name>.diag.log.4 is the oldest one

Setting trace size limit

In case trace level logging is enabled, users can set the size of the trace folder using parameter traceFolderLimit. By default, the value of this parameter will be 10, which signifies that the size limit for this folder will be 10 MB. This parameter is configurable and the user can set its value to any positive integer. The traces are stored within a separate folder for traces created under directory <Toolkit directory>/DB2/logs/<User>/. The filename format for traces would be <DB Name>.<sciprt name>.trace.<epoch time>. 

If the file is accidentally removed from the location, the plugin will generate the property file <Toolkit directory>/DB2/plugin-logging.properties with default values at runtime. For example, when the user will upload the plugin to DE, the first call to log function will check for the existence of <Toolkit directory>/DB2/plugin-logging.properties. If the plugin does not find this property file, it will create a property file with the content shown below.  The logs will start generating per the level defined inside the file. Below is the sample <Toolkit directory>/DB2/plugin-logging.properties file:

plugin-logging.properties

CODE
# This flag will set the debug level of logging. There are three levels:
 
# 1: Logging will be in info mode.
 
# 2: Logging will be in Debug mode.
 
# 3: Traces will be enabled along with debug level logging.
 
# The default value is 2.
 
# level=<positive integer>
 
level=2
 
# Whenever the size of <DB Name>.diag.log file exceeds 1MB the plugin will rename the active log file to  <DB Name>.diag.log.<number> and a new log file with name <DB Name>.diag.log will be generated.
 
# For example, if LogRetention is set to 4, the plugin will have the following  log files: <DB Name>.diag.log, <DB Name>.diag.log.1, <DB Name>.diag.log.2, <DB Name>.diag.log.3, <DB Name>.diag.log.4.
 
# File <DB Name>.diag.log.4 will be the oldest one.
 
# File <DB Name>.diag.log.1 will be the most recent archive log file.
 
# File <DB Name>.diag.log will be the active log file.
 
# For example, if LogRetention is set to 4, the plugin will have the following  log files: <DB Name>.diag.log, <DB Name>.diag.log.1, <DB Name>.diag.log.2, <DB Name>.diag.log.3, <DB Name>.diag.log.4.
 
# The default value for retention flag is 2, minimum value is 2 and maximum value is 50.
 
# retention=<positive integer>
 
retention=2
 
# The value for this property is configurable and must be a positive integer.
 
# The default value is 10.
 
# traceFolderLimit=<positive number>
 
traceFolderLimit=10

DB2 plugin v4.x and onwards

This feature adds three options to provide enhanced logging:

  1. To set debug log levels.

  2. To set active log file size.

  3. To set log retention levels.

Delphix users can modify the parameters defined under plugin_logging_parameters section header within the db2_plugin.conf file located at <Toolkit directory>/<Delphix_COMMON>/plugin/DB2_18f4ff11-b758-4bf2-9a37-719a22f5a4b8/db2_plugin.conf to configure the logging mechanism.

Setting log levels (level)

Delphix users can set log levels for plugin generated logs by setting the parameter level under plugin_logging_parameters header. Higher logging levels will help to expedite debugging issues. There are two levels of logging which are: Info and Debug. All the objects (both dSources and VDBs) present on a staging/target host will refer to a single property file. For example; if we have 4 dSources on a host associated with a Delphix Engine then the log level applies to all the dSources.

Log level description:

  • level=INFO: This level will print only informational logs. This is the default log level.

  • level=DEBUG: This level will print informational logs and debug statements.

Setting maximum size of active log file (logFileSize)

Delphix users can set this parameter under the plugin_logging_parameters header of the db2_plugin.conf file to set the maximum size of the active log file in MB. Once this limit is reached, the plugin will rotate the log as per the retention property defined below. The minimum value of this parameter is 1 MB and maximum value is 10 MB. This parameter only takes in a positive integer value. The default value is 1 MB.

Setting log retention levels (retention)

Delphix users can set a retention level for diag logs (.diag.log)="" using="" parameter="">retention under the plugin_logging_parameters header. As per this parameter, the log files are moved (archived), renamed or deleted once they reach the value set in logFileSize parameter. New incoming log data is directed into a new fresh file (at the same location).

By default, this value will be set to a minimum value of 2. The user can change this value and set its value within the range 2 and 50. For example; if retention is set to 4, the plugin will have the following log files: <DB Name>.diag.log, <DB Name>.diag.log.1, <DB Name>.diag.log.2, <DB Name>.diag.log.3, <DB Name>.diag.log.4. 

  • File <DB Name>.diag.log is  the active log file.

  • File <DB Name>.diag.log.1 is the most recent archive log file

  • File <DB Name>.diag.log.4 is the oldest one

db2_plugin.conf

CODE
#
# The parameters must not be left padded with spaces. The plugin will otherwise not accept the specified parameter
# values and will use the default values.
#
 
[plugin_custom_parameters]
#
# If the user has not shared a common group between primary environment user and instance user.
# Then the user needs to set parameter usersHaveCommonGroup as False.
#
 
usersHaveCommonGroup=True
 
#
# During provision operations the plugin checks if the target instance contains a database name which is identical to
# the source DB name from which the VDB is to be created. By default the plugin will never allow creating a VDB on the
# instance where the source database already exists, or on any instance that has a database with the same name. If the
# users still want to create a VDB on an instance which contains a database with the same name as the source DB then
# they need to set parameter allowSourceDbOnSameInstance as True.
#
 
allowSourceDbOnSameInstance=False
 
#
# If the users want to control the number of parallel restores then they can tune the parameter restorePipelineLimit.
# By default the value of this parameter would be 10.
#
 
restorePipelineLimit=10

#
# The archive logs validation process can be skipped if the end user so chooses. Instead, a speedier technique can be used,
# in which the archive logs are only validated for the first and last logs and the file sequences in between are confirmed.
#

skipArchiveLogValidation=True
 
[plugin_logging_parameters]
#
# This flag will set the debug level of plugin logs on the remote server (both staging and target). There are two levels:
# Info
# Debug
# The above are the only valid values that can be assigned. If any other value is assigned, the plugin will set the
# default level as Info. the string is case insensitive so info, Info and INFO are acceptable.
#
 
level=INFO
 
#
# This parameter will set the maximum size of the active log file in MB. Once this limit is reached, the plugin will
# rotate the log as per the retention property defined below. The minimum value of this parameter is 1 MB and maximum
# value is 10 MB. This parameter only takes in a positive integer value. The default value is 1 MB
# logFileSize=<positive integer>
#
 
logFileSize=1
 
#
# Whenever the size of <DB Name>.diag.log file exceeds the value provided by logFileSize parameter then the plugin will
# rename the active log file to <DB Name>.diag.log.<number> and a new log file with name <DB Name>.diag.log will be
# generated. For example, if LogRetention is set to 4, the plugin will have the following log files: <DB Name>.diag.log,
# <DB Name>.diag.log.1, <DB Name>.diag.log.2, <DB Name>.diag.log.3, <DB Name>.diag.log.4.
# File <DB Name>.diag.log.4 will be the oldest one.
# File <DB Name>.diag.log.1 will be the most recent archive log file.
# File <DB Name>.diag.log will be the active log file.
# The minimum and default value for retention flag is 2.
# retention=<positive integer>
#
 
retention=2
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.