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
- 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.
-
Ensure that you have the necessary file access permission to modify the parameters set for directories in the fileAccessControl.cnf configuration file.
-
If you have any older versions of Log4j installed, you must update to log4j 2.17.1 or a higher version.
-
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.
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.