Ce contenu n'est pas disponible dans la langue sélectionnée.

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:

  1. Configure Apache to include application names and gear UUIDs in its log messages by editing the /etc/sysconfig/httpd file and adding the following line:
    OPTIONS="-DOpenShiftAnnotateFrontendAccessLog"
    Copy to Clipboard Toggle word wrap

    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"
    Copy to Clipboard Toggle word wrap
  2. Restart the httpd service for the Apache changes to take effect for new applications:
    # service httpd restart
    Copy to Clipboard Toggle word wrap

Procedure 8.2. To Enable Application and Gear Context in Node Platform Logs:

  1. Configure the node platform to include application and gear context in its log messages by editing the /etc/openshift/node.conf file and adding the following line:
    PLATFORM_LOG_CONTEXT_ENABLED=1
    Copy to Clipboard Toggle word wrap
  2. 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
    Copy to Clipboard Toggle word wrap
    This produces key-value pairs for the specified attributes. If no context attribute configuration is present, all context attributes are printed.
  3. Restart the ruby193-mcollective service for the node platform changes to take effect:
    # service ruby193-mcollective restart
    Copy to Clipboard Toggle word wrap
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat