How to Configure Syslog on VMware vSphere 7 ESXi Hosts

VMware Syslog

VMware vSphere 7 includes a number of changes and new features from previous versions. One such change is the deprecation of the mksyslog.cfg file in favor of a centralized logging solution called vRealize Log Insight Agent. In this article, we’ll show you how to configure syslog on your vSphere 7 ESXi hosts so that you can take advantage of this new feature.

Configuring VMware Syslog on Your ESXi Hosts

  1. Login to the vSphere Client and select your ESXi host from the inventory.
  2. Click the “Configure” tab and select “Logging” from the list of options.
  3. Select “Actions” > “Edit Settings.”
  4. Under “Host Syslog Configuration,” select “Send log data to a remote syslog server.”
  5. Enter the IP address or hostname of your vRealize Log Insight server in the “Remote syslog server” field.
  6. (Optional) Change the port number if necessary. The default port for syslog is 514 UDP.
  7. Select “OK” to save your changes and close the dialog box.
  8. Repeat steps 1-7 for each additional ESXi host in your environment.
    9 That’s it! You have now configured syslog on your VMware vSphere 7 ESXi hosts. Be sure to check out our other articles for more tips and tricks on configuring and managing your virtual environment.

We’ve shown you how to configure syslog on your VMware vSphere 7 ESXi hosts so that you can take advantage of the new centralized logging feature in vRealize Log Insight Agent. By following the steps outlined above, you can quickly and easily get your ESXi hosts sending log data to your remote logging server without any further configuration required. As always, be sure to check out our other articles for more tips and tricks on configuring and managing your virtual environment.

How to configure VMware Syslog via ESXCLI?

The esxcli command line programme, which can be used at the console of an ESXi host, in the vCLI, or in the vMA, can be used to configure local and remote syslog functionality for a host.

See the vSphere Command-Line Interface Documentation for more information on how to utilise esxcli.

  1. Open a ESXi Shell console session where the esxcli command is available, such as the vCLI or on the ESXi host directly.
  2. Display the existing five configuration options on the host by running this command:
    esxcli system syslog config get
  3. Set new host configuration, specifying options to change, by running a command:
    esxcli system syslog config set --logdir=/path/to/vmfs/directory/ --loghost=RemoteHostname --logdir-unique=true|false --default-rotate=NNN --default-size=NNN
    For example:
    To configure remote syslog using TCP on port 514: esxcli system syslog config set --loghost='tcp://10.1.2.150:514'
  4. After making configuration changes, load the new configuration by running this command: esxcli system syslog reload
  5. Run this command to test if the port is reachable from the ESXi host:
    nc -z RemoteHostname 514
    For example:
    nc -z 10.1.2.150 514

If you are interested in understanding Syslog in general, read on!

Syslogging – What Is It and What Are Its Benefits?

Syslog is a standard for message logging. It allows separation of the software that generates messages, the system that stores them, and the software that reports and displays them. A wide variety of devices and applications can use syslog to record informational, debug, error, or critical messages.

Lots of different applications generate syslog messages, most commonly daemon processes or device drivers running on *nix servers. These applications typically write their log messages to files in /var/log/. Less frequently, application developers will also configure their applications to send syslog messages to a centralized logging server on the network. This is often done for security purposes so that an administrator can centrally monitor all activity taking place on the network from a single location.

How Does Syslog Work?

  • Syslog uses a client/server model. The actual message format is not specified in the syslog RFCs; instead, it is up to application developers to decide what information to include in their syslog messages. However, there are some standards that most syslog implementations adhere to. For example, all syslog messages must contain a header with the following information:
  • Facility: This is a code that indicates the general type of message (e.g., 0 for kernel message, 3 for mail).
  • Severity: This is a code that indicates how critical the message is (e.g., 0 for emerg, 5 for notice).
  • Timestamp: This is the time at which the message was generated.
  • Hostname: This is the hostname or IP address of the machine generating the message.
  • Tag: This identifies the process or application that generated the message.
  • Msg ID: This is an identifier for the type of message (e.g., IETF MSGID defined by RFC5424)
  • Content: This contains additional information about the message itself.

After the header comes the content of the message, which like we said before, is up to each application developer to determine. Some common pieces of information that are typically included are process IDs (PIDs), user IDs (UIDs), sequence numbers, and GPS coordinates.
syslog uses UDP port 514 by default; however, it can also be configured to use TCP port 601 instead. The main advantage of using UDP over TCP is that it’s “connectionless”—syslog clients don’t need to establish a connection with a server before sending their messages, which makes it faster and more efficient. However, because UDP doesn’t require handshakes or acknowledgment packets like TCP does, it’s also less reliable; there’s no guarantee that UDP syslog messages will actually reach their destination (although this isn’t usually a big problem since most syslog information isn’t mission critical).

So now you know what syslogging is and how it works! Syslog provides several benefits over traditional logging methods—it’s more efficient and less resource intensive, it offers better security due to its encryption capabilities, and it allows administrators to centrally monitor all activity taking place on their network from a single location. If you’re looking for a new logging solution for your organization, syslog should definitely be at the top of your list!