Show Table of Contents
8.5.2. Enabling Application and Gear Context in Node Component Logs
Further context, such as application names and gear UUIDs, can be included in log messages from node components, which adds visibility by associating entries with specific applications or gears. This can also improve the ability to correlate log entries using reference IDs from the broker.
Procedure 8.1. To Enable Application and Gear Context in Apache Logs:
- Configure Apache to include application names and gear UUIDs in its log messages by editing the
/etc/sysconfig/httpdfile and adding the following line:OPTIONS="-DOpenShiftAnnotateFrontendAccessLog"
Important
All options must be on the same line. For example, in Section 8.8.2, “Enabling Syslog for Node Components” another option for Apache log files is explained. If both options are desired, the line must use the following syntax:OPTIONS="-Option1 -Option2"
- Restart the
httpdservice for the Apache changes to take effect for new applications:#
service httpd restart
Procedure 8.2. To Enable Application and Gear Context in Node Platform Logs:
- Configure the node platform to include application and gear context in its log messages by editing the
/etc/openshift/node.conffile and adding the following line:PLATFORM_LOG_CONTEXT_ENABLED=1
- Add the following line to specify which attributes are included. Set any or all of the following options in a comma-delimited list:
PLATFORM_LOG_CONTEXT_ATTRS=request_id,container_uuid,app_uuid
This produces key-value pairs for the specified attributes. If no context attribute configuration is present, all context attributes are printed. - Restart the
ruby193-mcollectiveservice for the node platform changes to take effect:#
service ruby193-mcollective restart

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.