Configure the output of an activity log by setting properties in the ActivityLog section
of a node.conf.yaml or server.conf.yaml configuration
file.
Before you begin
Read the following topics:
About this task
You can configure the output of an activity log by setting properties in the ActivityLog section
of the
node.conf.yaml or
server.conf.yaml configuration
file:
ActivityLog:
#ActivityLogTemplate:
#enabled: true
#filter: ''
#minSeverityLevel: INFO
#elkLog: false
#elkConnections:
#fileName: /user/log/activitylog.txt
#numberOfLogs: 4
#maxAgeMins: 0
#maxFileSizeMb: 25
#formatEntries: false
#consoleLog: false
#consoleLogFormat: 'text'
#additionalJsonElements: '"name1": "value1", "name2": "value2"'
Procedure
Configure the output of an activity log by completing the following
steps:
- Open the node.conf.yaml or server.conf.yaml
configuration file by using a YAML editor.
You can edit the file by using the built-in YAML editor that is provided in the IBM® App Connect
Enterprise Toolkit, either by double-clicking the file in the Application
Development view or by right-clicking the file and selecting . If you choose to edit the file by
using a plain text editor, ensure that you use a YAML validation tool to validate the contents of
your file, and avoid including tab characters, which are not valid in YAML.
- Copy and customize the ActivityLogTemplate section for each activity log output
configuration that you want to create. This name must be unique.
For example, rename
ActivityLogTemplate to ActivityLog1
.
- Enable the activity log output configuration by setting the enabled
property to true.
For example:
ActivityLog:
ActivityLog1:
enabled: true
This property is set to true by
default. If this property is set to false, the other properties for this activity
log output configuration are ignored.
- Use the filter property to filter the information that is written to
the activity log. This property takes the form of tag-value pairs, and can be set to multiple values
delimited by semi-colons.
For example:
filter: 'NODETYPE=LOG'
In this example,
only entries that are generated by the
Log node are added to the activity log. By
default, no value is set, which means that no filtering is applied and all entries are added to the
log.
For a full list of tags and their valid values, see Activity log structure and types.
- Set the minSeverityLevel property to specify the minimum severity
level of messages that are written to the activity log output. Only messages with a severity level
equal to or above the specified value for this property are logged.
You can specify one
of the following values:
ERROR
(the highest severity level)
WARN
INFO
DEBUG
(the lowest severity level)
For example:
minSeverityLevel: INFO
- If you want to enable the logs to be published to an Elasticsearch, Logstash, and Kibana
(ELK) stack, set the elkLog property to true. This property is
set to false by default.
- If you have enabled the logs to be published to an ELK stack, use the
elkConnections property to specify the name of the ELK Connection configuration
to be used.
- If you want to write the output of the activity log to a file, use the
fileName property to specify the fully-qualified path and file name of the
activity log output file.
For
example:
fileName: /user/log/myLog
The most recent activities are logged to a file (in this example, myLog
). The
names of the other files in the circular log are constructed from the file name, suffixed with a
number. For example, a value of /user/log/myLog
results in log files named
myLog
(the current log file), myLog.1
, myLog.2
,
and so on, where files with higher suffixes contain older log entries.
By default, this property is set to an empty string (''
), which means that
writing the log to a file is disabled.
- Set the numberOfLogs property to specify the maximum number of files
that can make up the circular log.
This property can be set to any positive integer
greater than or equal to 1, and has a default value of 4.
- Set the maxAgeMins property to specify the maximum age (in minutes)
of an individual file in the circular log. When this age is reached, the log rotates to the next
file.
This property has a default value of 0 (zero), which means that file rotation based
on age is not performed.
- Set the maxFileSizeMb property to specify the maximum size (in
megabytes) of an individual file in the circular log. The default value is 25.
When this
size is reached, the log rotates to the next file. If the maximum size is not reached, and the
integration server is restarted, a new log file is created. If you set this property to 0, file
rotation based on file size is not performed.
- Use the formatEntries property to specify whether the activity log
entries are written to a file in formatted form.
The default value is
false, which means that the log column for formatted messages has no entries. A
separate log column exists for all the message inserts. Set the property to true to
generate formatted entries in the appropriate national language. The insert variables in these
entries are replaced with the insert values.
- Use the consoleLog property to control the writing of activity log
entries to standard out. You can set this property to true or
false. The default value is false.
- Use the consoleLogFormat property to control the format of activity
log entries that are written to standard out. You can set this property to idText,
text, or ibmjson. If this property is not set, the default value
is text.
- If the consoleLogFormat is set to ibmjson, use the
additionalJsonElements property to specify the JSON elements to be added to the
root of the logging object.
You specify these elements as comma-separated name-value
pairs, as shown in the following example:
additionalJsonElements: '"name1": "value1", "name2": "value2"'
- When you have finished setting the properties, save the file.