When syslog is configured on the ESXi host, only the system logs present in the scratch partition are forwarded to the syslog server.
This article explains the procedure to forward vmware.log for VMs to syslog server.
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x
cp /etc/vmware/config /var/core/vmware_config.backup
vi /etc/vmware/config
vmx.log.syslogID = "vmx"
Hit Esc ->
:wq!
vmx.log.syslogID
option allows you to tag or identify logs from a specific VM with a unique identifier when those logs are sent to the syslog server. This can be useful if you need to correlate logs from multiple VMs or differentiate logs from multiple VMs running on the same ESXi host. Edit Settings.
VM Options tab -> Advanced -> Configuration Parameters.
Edit Configuration -> Add configuration Params
Name = vmx.log.syslogID
and Value = <VM name>
https://techdocs.broadcom.com/it/it/vmware-cis/vsphere/vsphere/8-0/esxi-installation-and-setup-8-0/installing-and-setting-up-esxi-install/setting-up-esxi-install/configuring-system-logging-install/fine-tune-syslog-on-esxi-hosts-install.html