Increase the log level for Hostd service in ESXi 7.x and later
search cancel

Increase the log level for Hostd service in ESXi 7.x and later

book

Article ID: 403966

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to increase the log level setting for Hostd service in vSphere ESXi 7.0 Update 2 and later.

Environment

VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x

Resolution

Log level on the ESXi Host can be changed by the following 2 methods.

1. Using configstorecli via the ESXi shell.

  • First, extract the hostd.json config file using the below command.

             configstorecli config current get -c esx -g services -k hostd -outfile hostd.json

  • Edit the hostd.json using vi editor.

  • Go to the below section which should look like this.

   "log": {
      "directory": "/var/log/vmware/",
      "max_file_num": 8,
      "max_file_size": 524288,
      "name": "hostd",
      "output_to_console": false,
      "output_to_files": false,
      "output_to_syslog": true,
      "syslog": {
         "facility": "local4",
         "ident": "Hostd",
         "log_header_file": "/var/run/vmware/hostdLogHeader.txt"
      }

  • Add the log level field here. For example, if you wish to increase the log level to "trivia", below is how the modification will look like.

   "log": {
      "directory": "/var/log/vmware/",
      "max_file_num": 8,
      "max_file_size": 524288,
      "name": "hostd",
      "level": "trivia",
      "output_to_console": false,
      "output_to_files": false,
      "output_to_syslog": true,
      "syslog": {
         "facility": "local4",
         "ident": "Hostd",
         "log_header_file": "/var/run/vmware/hostdLogHeader.txt"
      }

  • Save the file.

  • Re-apply the modified hostd.json file using the below command.

             configstorecli config current set -c esx -g services -k hostd -infile hostd.json

  • Restart hostd process using command below.

             /etc/init.d/hostd restart

 

2. Using vSphere UI.

  • From the vSphere UI, navigate to the ESXi Host > Configure > Advanced system settings.

  • Go to the settings Config.HostAgent.log.level and set it from "info" to "trivia".

  • Save the setting.

  • Restart hostd from the cli using the below command.

        /etc/init.d/hostd restart

Additional Information