Fine-tuning message processor logging levels on Private Cloud

Hi API Developers,

While we provide a tokenized way of setting the overall log level for an Apigee component[1], sometimes there may be a requirement to tune the log level for a specific logger within a component. For example, an operations administrator may need to:

i) suppress logs that contain sensitive information.

ii) suppress overly verbose logs that consume too much disk space.

iii) permanently add DEBUG logging for a specific policy. (as opposed to temporarily enabling component-wide debug logging[2])

To change INFO level to WARN for a specific logger on the edge-message-processor component, follow the below steps:

1. (Optional - if doing it for the first time) Back up the following file: /opt/apigee/edge-message-processor/source/conf/logback.xml

cp /opt/apigee/edge-message-processor/source/conf/logback.xml /opt/apigee/edge-message-processor/source/conf/logback.xml.backup 

2. Identify the 'logger name' of the messages you wish to suppress. For example in the below line:

2019-03-31 00:11:02,898  Thread-50 INFO  FILE_LOGGER - BufferedWriter.getSizeAtMessageBoundary() : file rotation due - detected

In the default logging pattern, the logger name will always come after the log level. There will also be a hyphen character after the logger name.

Therefore in this example, the logger name is 'FILE_LOGGER'.

2. Append the following line to /opt/apigee/edge-message-processor/source/conf/logback.xml, inside the <configuration> element at the bottom.

<logger name="FILE_LOGGER" level="WARN"/> 

3. Restart the MP:

apigee-service edge-message-processor restart 

You should see a message in the console output:

[InsertDelta, position: 424, lines: [ <logger name="FILE_LOGGER" level="WARN"/>]]

4. verify that the log messages no longer show up in /opt/apigee/var/log/edge-message-processor/logs/system.log

[1] https://docs.apigee.com/private-cloud/v4.19.01/setting-log-level-edge-component

[2] https://docs.apigee.com/private-cloud/v4.19.01/enabling-debug-logging

Version history
Last update:
‎03-31-2019 05:52 PM
Updated by: