Skip to main content
SnapCenter 4.9 cmdlets

Set-SmLogSettings

Contributors

Sets the log file retention for SnapCenter, hosts, and plug-ins.

Syntax

Set-SmLogSettings [-Server]  <>  [-MaxFileSize]  <Int64>  [-MaxSizeRollBackups]  <Int32>  [-JobLogsMaxFileSize]  <Int64>  [-LogLevel]  <LogLevel>  [-UniversalTime]  <Boolean>  [-Agent]  <>  [-HostName]  <String>  [-MaxFileSize]  <Int64>  [-MaxSizeRollBackups]  <Int32>  [-JobLogsMaxFileSize]  <Int64>  [-LogLevel]  <LogLevel>  [-UniversalTime]  <Boolean>  [-Plugin]  <>  [-HostName]  <String>  [-PluginCode]  <PluginCode>  [-MaxFileSize]  <Int64>  [-MaxSizeRollBackups]  <Int32>  [-JobLogsMaxFileSize]  <Int64>  [-LogLevel]  <LogLevel>  [-UniversalTime]  <Boolean>

Detailed Description

Sets the log file retention for SnapCenter, hosts, and plug-ins. Log file settings govern log severity level, the maximum log file size, the maximum number of log file backups to retain, and the maximum size for all the job log files.

Parameters

Name Description Required? Pipeline Input Default Value

Server

Indicates that you want to create log settings for the SnapCenter server.

true

false

MaxFileSize

The log file size that triggers a roll over.

true

false

MaxSizeRollBackups

The number of roll over log files that are retained.

true

false

JobLogsMaxFileSize

Specifies the maximum file size of all job log files. Job logs are created on an individual job basis. JobLogsMaxFileSize specifies the total size for all job log files. When job log files exceed the maximum size, the oldest files are deleted.

true

false

LogLevel

Sets the log severity level. Valid values are: all, debug, info, warn, error, fatal, or off.

true

false

UniversalTime

Enables message logging in UTC time for installations in different geological locations. Use $True to enable UniversalTime or $False to disable UniversalTime.

false

false

Agent

Indicates the SnapCenter agent on which you want to create the log settings. Possible values are -server, -host, or -plugin.

true

false

HostName

Specifies the host name on which the log files are created. The host should be part of the SnapCenter managed host list and the host is required when you want to create log settings for the SnapCenter host agent or plug-ins.

true

false

Plugin

Indicates that you want to specify log file settings for a plug-in host.

true

false

PluginCode

Indicates the plug-in code for the plug-in host on which you want to specify log settings. Valid plug-in values are SCSQL, SCO, SCV.

true

false

Examples

Example 1: Setting SnapCenter server log settings

 Set-SmLogSettings -JobLogsMaxFileSize 100MB -LogLevel All -MaxFileSize 10MB -MaxSizeRollBackups 10 -Server

This example syntax sets SnapCenter server log settings.

LogSettingsId  : 1
LogSettingsType: Server
LogLevel   : All
MaxFileSize: 10485760
MaxSizeRollBackups : 10
JobLogsMaxFileSize : 104857600
HostId :
HostName   :
PluginInfoId   :
PluginCode : NONE

Example 2: Setting plugin log settings

 Set-SmLogSettings –Plugin –PluginCode SMSQL -HostName host123 -JobLogsMaxFileSize 100MB -LogLevel Info -MaxFileSize 10MB -MaxSizeRollBackups 10

This example syntax sets plug-in log settings.

LogSettingsId  : 1
LogSettingsType: Plugin
LogLevel   : Info
MaxFileSize: 10485760
MaxSizeRollBackups : 10
JobLogsMaxFileSize : 104857600
HostId :
HostName   :
PluginInfoId   :
PluginCode : SMSQL

Example 3: Setting SnapCenter host agent log settings

 Set-SmLogSettings -Agent -HostName bryankDev -JobLogsMaxFileSize 100MB -LogLevel Info -MaxFileSize 10MB -MaxSizeRollBackups 10

This example syntax sets plug-in log settings.

LogSettingsId  : 1
LogSettingsType: Agent
LogLevel   : Info
MaxFileSize: 10485760
MaxSizeRollBackups : 10
JobLogsMaxFileSize : 104857600
HostId :
HostName   :
PluginInfoId   :
PluginCode : NONE

Example 4: Setting log messaging to UTC time

 Set-SmLogSettings -Agent -HostName <plugin-hostname> -JobLogsMaxFileSize 10MB -LogLevel Debug -MaxFileSize 10MB -MaxSizeRollBackups 10 -UniversalTime $True

This example syntax sets log messaging to Universal time.