KonAdams70
Enthusiast
Enthusiast

Help with Changing Syslog.global.LogDir

Jump to solution

Hi guys,

Would like a hand in being able to change the location of our syslogs and to also increase the size of log files.

Having an issue now, where within the first 6 months of this new setup we have run out of disk space "Ramdisk Var is full".

Current settings are the default. size of logs are at 1024 and default location of scratch directory.

I am running vSphere 6.7 with only 2 hosts. Each host has plenty of local disc space. Would like to set up new location on local disc with 5MB size and 10 rotations.

I am just unsure of how to create new directory to point to.

Thanks

0 Kudos
1 Solution

Accepted Solutions
Sukanyad
VMware Employee
VMware Employee
  1. Login to vSphere Web Client.
  2. Go to Manage \ Settings \ Advanced System Settings. In search field type Syslog.global.logDir and hit Enter. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
  3. Double click on Syslog.global.logDir and enter name of the datastore where you want to store logs in format [datastore_name]folder. In my case it looks like that: [ESXi01-local]logs. After you commit change alert on ESXi disappears. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
  4. Browse datastore where we store ESXi logs to check if settings are applied correctly. ![Change location of VMware ESXi System Logs to local or remote datastore - 3][4]

View solution in original post

0 Kudos
15 Replies
IRIX201110141
Virtuoso
Virtuoso

Just open a SSH or login into to the local shell and type

df -h
cd /vmfs/volumes
ls -alh
cd yourlargedatastore
mkdir youresx1

The yourlargedatastore can be a shared or local one.

Now use esxcli to specify the syslog parameter you want and to get rid of the full ramdisk you need to restart the host.  You can than check the content of the youresx1 directory.

Btw. before restarting you can set the scratch disk as well. See VMware Knowledge Base

Regards,
Joerg

0 Kudos
KonAdams70
Enthusiast
Enthusiast

Hello Joerg,

Thank you for your reply.

I have been able to create the directory which is currently to the local disc of host.

Whenever I try to change syslog directory from the GUI I get an error: A Specified parameter was not correct.

I am using the datastore and the new directory I added like so:  [localdatastore] /youresx1/

This is what is driving me nuts.  Smiley Sad

I feel like I need to do a reboot of host and then maybe I might be able to make the change. and then reboot again to create a persistant scratch location.

With the current system not allowing me to migrate any vm's I have to do this after hours.

0 Kudos
Sukanyad
VMware Employee
VMware Employee
  1. Login to vSphere Web Client.
  2. Go to Manage \ Settings \ Advanced System Settings. In search field type Syslog.global.logDir and hit Enter. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
  3. Double click on Syslog.global.logDir and enter name of the datastore where you want to store logs in format [datastore_name]folder. In my case it looks like that: [ESXi01-local]logs. After you commit change alert on ESXi disappears. ![Change location of VMware ESXi System Logs to local or remote datastore - 2][3]
  4. Browse datastore where we store ESXi logs to check if settings are applied correctly. ![Change location of VMware ESXi System Logs to local or remote datastore - 3][4]

View solution in original post

0 Kudos
KonAdams70
Enthusiast
Enthusiast

Hi Sukanyad,

Thank you for your reply.

I have a similar named datastore to you and have created a folder.

Datastore name is bresx03-local and folder name is syslog-esx03.

So when I add that in this format [bresx03-local] /syslog-esx03  I get an error message "A specified parameter was not correct:"

0 Kudos
Sukanyad
VMware Employee
VMware Employee

The syntax is incorrect

try the below:

[bresx03-local] syslog-esx03

0 Kudos
KonAdams70
Enthusiast
Enthusiast

I have tried that.

Just tried it again, I get the same error.

I just wonder that the current state of hosts with "ramdisk var full" error.

I need to reboot hosts to clear that out first I think.

0 Kudos
Sukanyad
VMware Employee
VMware Employee

yes you need to clear space otherwise it wont work . Smiley Happy

Also reboot the host and try again.

0 Kudos
KonAdams70
Enthusiast
Enthusiast

I do have one other question.

If I make changes for a persistent scratch location, which I can see is done in the Scratch.ConfiguredScratchLocation field, Im assuming I dont need to change the path in the Syslog.global.LogDir?

0 Kudos
Sukanyad
VMware Employee
VMware Employee

Yes if the scratchconfig is already configured to a shared datastore we dont need syslog .

0 Kudos
KonAdams70
Enthusiast
Enthusiast

Awesome,

Well, I'm rebooting Hosts in about 2 hours.

Hope it all reboots OK with no issues.  :smileyconfused:

0 Kudos
Sukanyad
VMware Employee
VMware Employee

Yes let me know the status

0 Kudos
KonAdams70
Enthusiast
Enthusiast

OH, one more thing.

How do I check if logging is happening to new scratch location?

0 Kudos
Sukanyad
VMware Employee
VMware Employee

Just open a SSH or login into to the local shell and type

ls -l

you can see scratch config location

or

cd /var/log/

it should take to datastore where logs are present

0 Kudos
KonAdams70
Enthusiast
Enthusiast

Hi Sukanyad,

Have rebooted hosts and no issues at all.

New scratch location has been changed as I wanted to.

All good.

Thanks for your help. Much appreciated.

0 Kudos
Sukanyad
VMware Employee
VMware Employee

Welcome Smiley Happy

0 Kudos