I am using ESXi 5.0 in a development environment. Before an automated test is run I want to set the vmkernel.log file to be empty. Then when the test completes the only thing in the log file is what occurred during the test.
I tried the usual '> vmkernel.log' and 'cat /dev/null > vmkernel.log'. This creates a file of size 0, but when the test runs VMware writes about 170,000 garbage characters (^@^@^@^@^@^@^ etc.) into the file before it starts logging. This defeats the purpose of having a small file to parse.
I have looked into using the vMA CLI commands. For example
esxcli --config bin/vMA_CLI.cfg system syslog config logger set --id=vmkernel --size=1 --rotate=1
and
esxcli --config bin/vMA_CLI.cfg system syslog reload
but nothing seems to set the file to 0, or 1, byte. Nor can I find 'logrotate' to force the file to rotate.
I cannot believe there is not a way to zero a log file, so I need your help in how to do that.
Thanks.