Redirect ESXi logs to a local datastore
By default, ESXi stores all of its vital logs on a non-persisting location. This means if the host crashes, reboots or shuts down no information is available on the root cause. Let's see how to change this.
All information has been gathered from the VMware knowledgebase. However ESXi is using an idiotic format, and I had troubles trying to set the new log directory via the vSphere Client.
There are two options available:
1, Setting new syslog location using SSH and esxcli
This was the was I went on with. First, enable SSH by Configuration > Security Profile. On the Services section click on Properties... link and select SSH. Click on the Options... and then the Start button. Voila, your ESXi host is now reachable through SSH. The only thing left now is to connect to your host with SSH and execute the command:
esxcli system syslog config set --logdir=/path/to/vmfs/directory/
To apply the changes, enter:
esxcli system syslog reload
2, Setting new syslog location using vSphere Client
This is the easier solution, but the naming convention confused me a lot. Go to Configuration, and in the Software section click on the Advanced Settings link. Scroll down to Syslog and find the option called Syslog.global.logDir and enter the value:
[Data Store Name] Folder
Now, let's say your data store is called "DataStore" and your folder is called "Logs". What you'll have to enter is:
...including the brackets and a space (?!)
Don't ask, but it works.