Retrieves entries from vSphere logs.


Get-Log [-Key] <String[]> [[-VMHost] <VMHost[]>] [[-StartLineNum] <Int32>] [[-NumLines] <Int32>] [-Server <VIServer[]>] [<CommonParameters>]
Get-Log [[-VMHost] <VMHost[]>] [-Bundle] [-DestinationPath] <String> [-Server <VIServer[]>] [-RunAsync] [<CommonParameters>]

Related Commands


Detailed Description

Retrieves entries from vSphere logs. Returns portions of the log files according to the criteria provided by the cmdlet parameters.
To specify a server different from the default one, use the -Server parameter.


NameDescriptionRequired?Pipeline InputDefault Value
KeySpecify the key identifier of the log file you want to retrieve. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.truetrue (ByValue)
VMHostSpecify the hosts for which you want to retrieve logs. If no value is given to this parameter, the command returns logs only for the default vSphere server.falsetrue (ByValue)
StartLineNumSpecify the start line number for reading from the logs.falsefalse
NumLinesSpecify the number of the lines you want to retrieve from the logs.falsefalse
ServerA vSphere servers to apply the command on. If no value is given to this parameter, the command runs on the server currently specified in the $DefaultVIServer variable.falsefalse
BundleIndicate whether to retrieve a diagnostic bundle of logs from the vSphere server.falsefalse
DestinationPathSpecify a local file path where you want to save the log bundle.truefalse
RunAsyncIndicate that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the -RunAsync parameter run " help About_RunAsync" in the vSphere PowerCLI console.falsefalse

Input Type

Return Type




--------------  Example 1 --------------

C:\PS>$keys = Get-LogType 

Get-Log -Key $keys[0]

Obtain the available keys. Obtains the first log file from the currently connect
ed vSphere server.

Copyright © 1998 - 2009 VMware, Inc. All rights reserved.