Changing the directory of your vSphere vCenter log files

Something that a lot of people haven’t looked in to or just don’t think about is relocating the log files of vCenter, I wrote a short article 2 years ago and thought it was time to reiterate it. By default (Windows 2003) log files are stored in “C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\Logs”, and for Windows 2008 log files are stored in “C:\ProgramData\VMware\VMware VirtualCenter\Logs”.

As you can imagine the C:\ partition is not the ideal place for storing log files. I would personally recommend to use a separate drive for logfiles so avoid it from flooding any OS or Program related drives. You could pick a small size based on the expected log size and if needed increase the amount of logs that are stored and the size of the log file.

Changing this is pretty simple. Open “vpxd.cfg” and add the following line in between <log> and </log>

<directory>D:\VMware\Logs</directory>

Changing the amount of log files stored and the size is also pretty basic, in this example vCenter will store 10 logfiles which are max 10MB each:

<maxFileSize>10485760</maxFileSize>
<maxFileNum>10</maxFileNum>

Keep in mind that you will need to restart the vCenter Service after these changes before they take effect!

You can skip to the end and leave a response. Pinging is currently not allowed.

9 Responses to “Changing the directory of your vSphere vCenter log files”

  1. Jason Miles says:

    Thanks Duncan….Good reminder!

    Wonder who sparked this one!? :)

    Seriously, thanks for giving back to the community.

  2. Seva says:

    1. vCenter (v 4.+) zips log files
    2. trivia sets the log level
    3. The article contradicts itself: with maxFileSize and maxFileNum we always could compute, how much space log files will require, thus they will never flood the OS disk. The idea to put log files on separate volume is bad bacause it increases complexity of vCenter configuration.

  3. Seva says:

    2 I mean the tag level ( hopefully it will work now: \ )

  4. René van Balen says:

    Also, don’t forget to remove any html comment lines like <!– above and –> below . I am using vCenter Server 4 update 1 and those comment lines were present by default in vpxd.log.

  5. Duncan says:

    I don’t agree Seva. what’s complicated about a relocation of your logfiles to a directory which might make more sense. For a lot of enterprise customers it is internal policy to redirect all log files to a given disk.

  6. kyle says:

    The vCenter install should let you change this during install or atleast through the GUI. :(

  7. Seva says:

    Well, Duncan,
    previous argument was to “avoid it from flooding any OS or Program related drives”, now we see, that the size of vCenter log files is predictable and, let’s say, finite. And now we have a nebulous “internal policy to redirect all log files to a given disk.”

    I still can not understood the reason for hacking around with the goal
    1) Just to confuse support specialist or PSO guy making healthcheck
    2) To disrupt the work of script which prepares log file bundle for support.
    3) Just to repeat it again make the design of vCenter VM more complicated by adding the new disk.

    And btw. there are a lot of other log and dump files in the same directory three, what about them?

    Duncan, your article is really useful, because it will really make sense to increase the size and amount of vCenter log files if you’re making verbose and trivia logging. And I WOULD advise to turn on verbose logging BEFORE you got an outage, and not AFTER it – “Dear customer, due to too low level of logging we have to increase it to verbose and wait until the outage in your datacenter will be happened for the second time” – advice I often heard from support .

    Conclusion – if you would change the title of your entry to “How to increase the number and size of vCenter” logs and would explain, how to do it and how to compute the expected size of log file with recommendations that verbose logging as standard would be a good choice, that if logs will require too much space they may be moved, but there are some risks connected to it. In that case it would be really helpful entry

    best regards
    =Seva

  8. I wouldn’t want to call a default setting in a config file hacking. Like I said, many enterprise customers have the REQUIREMENT to store log files on a separate drive for several reasons. (Hey there’s a reason /var/log is a separate partition in Linux / ESX!)

    but let’s agree to disagree.

  9. Rob says:

    You didn’t mention where to find vpxd.cfg! I’ve searched the whole server and nothing. Thanks for any help provided.

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!