How to forward service logs to a syslog server in VMware Cloud Director Availability
search cancel

How to forward service logs to a syslog server in VMware Cloud Director Availability

book

Article ID: 315033

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

This article provides information on how to forward the logs from each of the VMware Cloud Director Availability (VCDA) services to a central syslog server.

Environment

VMware Cloud Director Availability 4.x

Resolution

The logging for each VMware Cloud Director Availability service is controlled by a logback.xml file. To forward the VMware Cloud Director Availability logs to a syslog server, you need to update this file for each service individually. The location of the file for each service is:

Service Default Location
Cloud Service /opt/vmware/h4/cloud/config/logback.xml
Manager Service /opt/vmware/h4/manager/config/logback.xml
Replicator Service /opt/vmware/h4/replicator/config/logback.xml
Tunnel Service /opt/vmware/h4/tunnel/config/logback.xml

Warning: Incorrectly modifying the logback.xml file can result in the corresponding service to fail to start. Ensure to follow the steps below exactly as described, adding the new lines to the specified locations of the logback.xml file.

To forward the VMware Cloud Director Availability logs to a syslog server perform the following steps:

  1. SSH to the VMware Cloud Director Availability component VM whose logs you want to forward.
  2. Navigate to the /opt/vmware/h4/service/config/ directory.
  3. Create a backup of the logback.xml file.
cp -p logback.xml logback.xml.bak
  1. Add the following to the configuration section of the logback.xml file above the root section:
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
   <syslogHost>syslogIpAddress</syslogHost>
   <port>514</port>
   <facility>LOCAL7</facility>
   <suffixPattern>[C4] [%X{operationID}] [%thread] %-40.40logger{39}: %msg</suffixPattern>
</appender>
  1. Register the new appender by adding the following line to the root section of the logback.xml file:
<appender-ref ref="SYSLOG" />
  1. Save and exit the logback.xml file.
  2. Log into the management portal for the service.
  3. In the left pane, click System Monitoring.
  4. Under System health, click Restart Service.

Additional Information

For more information, see The logback manual - Chapter 4: Appenders - SyslogAppender.

Disclaimer: VMware is not responsible for the reliability of any data, opinions, advice, or statements made on third-party websites. Inclusion of such links does not imply that VMware endorses, recommends, or accepts any responsibility for the content of such sites.