Custom Logs

Custom logs offer critical insights for monitoring and troubleshooting issues during service execution. You can create a separate custom log file for each service and configure automatic log rotation.

Before You Begin

  1. Make sure that the custom log file resides in the following directory: /IntegrationServer/instances/default/logs/custom_pkg_logs/<file_name>.log. You cannot change the location of the log file.
  2. Ensure that you have the necessary file access permission to modify the parameters set for directories in the fileAccessControl.cnf configuration file.

  3. If you have any older versions of Log4j installed, you must update to log4j 2.17.1 or a higher version.

  4. As a best practice, the logs must be rotated periodically based on the size or on the date. It is recommended to rotate the custom log when the custom log file size reaches 50 MB size or at midnight, whichever occurs first.

Generating custom log files for each service

You can create separate log files for each service. To generate these custom log files, you specify the desired file name and folder path as part of the service’s input parameters. This flexibility helps in structuring logs according to your needs and keeping service logs isolated.

Example

Creating a separate log file for the service pub.file:stringToFile

To create a custom log file for the service pub.file:stringToFile, provide the following pipeline inputs:

fileName: logs/custom_pkg_logs/Customlogs.log.123456 - Specify the full path and file name where the log will be saved.

data: The string content that you want to write to the log file.

append: true - Set to true if you want new log entries to be added to the existing file instead of overwriting it.

encoding: UTF-8 - Specifies the character encoding to use when writing the log.

Note: By default, custom log files do not include a Log4j configuration, and therefore, they do not support automatic log rotation on their own. However, you can configure your own Log4j properties file based on your service implementation to generate and manage custom log files, beyond those created using services such as pub.file:stringToFile. webMethods Cloud container supports automatic rotation for all log files located in the IntegrationServer/instances/default/logs directory. Any files placed in this directory will be included in the log rotation process and made available for download under the Monitoring > Logs page.

How to Identify Custom Log Entries?

Upon rotation, you can view the custom log file through the Monitoring > Logs page of IBM® webMethods Cloud Container. Use the following format to identify the custom log entries:

<file-name>.log.<time_stamp>.yyyymmdd.time_stamp.zip

Downloading the Custom Log

To download the custom log details, click    under Actions.