First Published on TechNet on Oct 12, 2011
As of System Center Configuration Manager Current Branch 1806, the default log settings DURING the Task Sequence are set as follows:
Log Max Size: 5MB
Log Max History: 3
Log Level: Verbose
Debug Logging: Enabled
For most scenarios in 1806 or newer, it is no longer necessary to change log settings for the Task Sequence to prevent losing log history or to capture additional information. For this reason the instructions in this article can be skipped in most instances.
Once the Task Sequence completes, log settings are reset back to defaults.
Want to set the logging quickly without reading a bunch of details? Then follow the below three sections:
When deploying a Task Sequence, there may be times that the options of the SMSTS.log file need to be changed, such as increasing the size of the log or the amount of historical logs (rolled over logs) that are created. If the SMSTS.log size is not increased or the amount of historical logs is not increased, information about what happened during the Task Sequence may be lost. In troubleshooting scenarios this may make it difficult to determine what is causing problems.
The Task Sequence has the potential of running in three different Windows OSes before it completes:
Because of this, if options for the SMSTS.log file need to be changed, they may need to be changed each time the Windows OS changes. This can be up to three different times during a Task Sequence.
In order to change the options for the SMSTS.log, they need to be changed in three different locations:
Additionally, in order for the logging options to work properly throughout the deployment, the settings for the logging options should match and be the same during each stage of the deployment.
IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is always initialized in WinPE. For this reason, even if extended logging is only needed in the newly installed Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so will result in extended logging not being enabled while the Task Sequence is running and instead will only be enabled AFTER the Task Sequence completes.
Original Windows OS: Modify the registry in the original Windows OS (Replace, Refresh, & In-Place Upgrade scenarios only)
When the ConfigMgr client is originally installed on a PC, the ConfigMgr client logging options can be set via MSI properties in the command line of the client install. These options include the following properties:
CCMDEBUGLOGGING
CCMENABLELOGGING
CCMLOGLEVEL
CCMLOGMAXHISTORY
CCMLOGMAXSIZE
The above properties are described in the following TechNet articles:
System Center Configuration Manager 2007
About Configuration Manager Client Installation Properties
http://technet.microsoft.com/en-us/library/bb680980.aspx
System Center 2012 Configuration Manager
About Client Installation Properties in Configuration Manager
http://technet.microsoft.com/en-us/library/gg699356.aspx
System Center Configuration Manager (Current Branch)
About client installation properties in System Center Configuration Manager
https://technet.microsoft.com/en-us/library/mt489016.aspx
To change any of the above properties after the ConfigMgr client has been installed, instead of reinstalling the client with the necessary parameters, the corresponding registry entries can be changed either manually or via a REG.exe command line:
ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\DebugLogging
ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\DebugLogging
Value name: Enabled
DataType: Reg_SZ
A value of TRUE enables debug logging. Deleting the DebugLogging key disables debug logging.
An example of setting or changing CCMDEBUGLOGGING via a REG.exe command line would be:
REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging" /v Enabled /t REG_SZ /d TRUE /f
In the above example command line, debug logging is turned on.
ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL
ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL
Value name: LogEnabled
DataType: Reg_DWORD
A value of 1 enables logging, while a value of 0 disables logging. The default is 1 (enabled). Since logging is enabled by default, CCMENABLELOGGING normally does not need to be changed.
An example of setting or changing CCMENABLELOGGING via a REG.exe command line would be:
REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogEnabled /t REG_DWORD /d 1 /f
In the above example command line, logging is enabled.
ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL
ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL
Value name: LogLevel
DataType: Reg_DWORD
The value can range from 0 to 3, with 0 being the most verbose logging. The default value is 1.
An example of setting or changing CCMLOGLEVEL via a REG.exe command line would be:
REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogLevel /t REG_DWORD /d 0 /f
In the above example command line, the log level is set to the most verbose.
ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL
ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL
Value name: LogMaxHistory
DataType: Reg_DWORD
The value specifies the amount of rolled over/historical logs to keep. This does not include the current log. A value of 3 would keep a total of 4 logs - the current log and 3 rolled over/historical logs. The default value is 1.
An example of setting or changing CCMLOGMAXHISTORY via a REG.exe command line would be:
REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxHistory /t REG_DWORD /d 3 /f
In the above example command line, the number of rolled over logs that are kept is increased to 3.
ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL
ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL
Value name: LogMaxSize
DataType: Reg_DWORD
The value specifies the size of the log file in bytes. The default value is 250000(decimal)/3d090(hexadecimal) which equals 250000 bytes (approximately 245 KB). To convert from kilobyte to bytes, multiply by 1024. To convert from megabytes to bytes, multiply by 1048576 (1024 x 1024).
An example of setting or changing CCMLOGMAXSIZE via a REG.exe command line would be:
REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxSize /t REG_DWORD /d 5242880 /f
In the above example command line, the log file size is increased to 5MB (5242880 bytes).
Note:
After the value of any of the above values has been changed in the registry, the ConfigMgr client needs to be restarted in order for the changes to take effect. This can be done by manually restarting the SMS Agent Host service (CCMExec) or restarting the computer. The SMS Agent Host service can also be restarted via the following two command lines:
net stop ccmexec
net start ccmexec
When a Task Sequence first begins in the full OS either automatically via a mandatory/required deployment or manually via Run Advertised Programs/Software Center, it reads the current logging values from the above registry keys and assigns the following Task Sequence variables to those values:
_SMSTSLogDebug
_SMSTSLogEnabled
_SMSTSLogLevel
_SMSTSLogMaxHistory
_SMSTSLogMaxSize
The SMSTS.log then uses the values specified in the above variables to set its logging options. Since this is all done when the Task Sequence first starts, attempting to change the registry values after the Task Sequence has begun and is running will not change the logging options for the running Task Sequence. Additionally, because the above are read only variables, attempting to change their value during the running Task Sequence will also not work.
If when attempting to modify any of the above registry keys you receive the following error message:
Error Editing Value
Cannot edit <value>: Error writing the value's new contents
where <value> is the key value trying to be changed, this is usually due to insufficient permissions on the @GLOBAL registry key for the user trying to make the change. You may also run into similar permission issues when running the Reg.exe commands. To resolve the issue, modify the permissions of the @GLOBAL key to allow the user making the changes to modify the values under the key.
Automating Changing SMSTS.log Settings in the Original OS
In order for modified log settings to take effect during a Task Sequence, the log settings need to be modified BEFORE the Task Sequence starts. In scenarios where the Task Sequence is started in WinPE, this is done via the SMSTS.ini file. However for Task Sequences that start in the full OS via Software Center/Run Advertised Programs or a Required/Mandatory deployment, the changes need to be done via modifications to the registry keys mentioned in the above section. When the Task Sequence starts, it will read the values from the above registry keys and then set those values as the log settings during the Task Sequence. The easiest way to achieve this is through a script which is run via the option “Run another program first” in the Properties of the Task Sequence
To automate modifying the SMSTS.log settings before the Task Sequence executes in the original OS:
A restart of the ConfigMgr client service (SMS Agent Host) is not needed because when the Task Sequence initiates, it will read the values of the registry keys directly to set the logging values for the Task Sequence. It does not read the values from the current ConfigMgr client session/environment.
IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is still initialized in WinPE. For this reason, even if extended logging is set in the original Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so may cause extended logging not to be enabled during the WinPE and newly installed Windows portions of the Task Sequence.
Windows PE Boot Image: Add the SMSTS.ini file to the Windows Directory of the Boot Images (New Computer, Refresh, and Replace scenarios)
During an OSD Task Sequence, when the PC boots into WinPE from the Boot Image, the SMSTS.log settings are not controlled via the same registry keys as in the full Windows OS. Instead the SMSTS.log settings are controlled via entries in a file called SMSTS.ini file which resides in the Windows directory of WinPE.
The logging options and values that can be modified in the SMSTS.ini file are:
DEBUGLOGGING
ENABLELOGGING
LOGLEVEL
LOGMAXHISTORY
LOGMAXSIZE
The above value names are basically the same as the registry value names from the full OS, but without the preceding CCM prefix.
Similar to when the Task Sequence begins in the full OS, when the Task Sequence begins in WinPE, it reads the above values from the SMSTS.ini file and then assigns the values to the following variables:
_SMSTSLogDebug
_SMSTSLogEnabled
_SMSTSLogLevel
_SMSTSLogMaxHistory
_SMSTSLogMaxSize
The SMSTS.log then uses the values specified in the above variables to set its logging options. Since this is all done when the Task Sequence first starts, attempting to add an SMSTS.ini file or change its values after the Task Sequence has begun and is running will not change the logging options for that particular running Task Sequence. Additionally, because the above are read only variables, attempting to change their value during the running Task Sequence will also not work.
In order to change the logging options for the SMSTS.log file while in WinPE, the SMSTS.ini file has to be either created or modified with the appropriate parameters. If no SMSTS.ini file exists in the Windows directory of WinPE, then default values are used. By default, the SMSTS.ini file does not exist in the default Boot Images of ConfigMgr and therefore default values are used.
To modify the values, an SMSTS.ini file needs to be created with a [Logging] section that contains the parameters that need to be modified. The file then needs to be added to the Windows directory of the Boot Image.
For example, to change the SMSTS.log file size to 5MB, set the log level to the most verbose level, increase the amount of rolled over/historical logs to 3, and enable debug logging, the following would be the contents of the SMSTS.ini file:
[Logging]
LOGLEVEL=0
LOGMAXSIZE=5242880
LOGMAXHISTORY=3
DEBUGLOGGING=1
Notes
Injecting the SMSTS.ini file into the Boot Image
ConfigMgr stores files to be injected into the Boot Images under the following two directories on the site server:
The files located in the above two directories are not necessarily automatically injected into the Boot images. An XML file is used which defines which files need to be injected, where the files are located within the BIN directory, and where they need to be copied to within the WinPE Boot Image. The name of this XML file is osdinjection.xml. It is located in the following directory on the site server:
Notes
To inject the SMSTS.ini file into the Boot Images:
Once the Distribution Points have finished updating for each Boot Image, each Boot Image should have the updated log settings for the SMSTS.log.
Instead of using the above process, the SMSTS.ini file can be manually injected into the Windows directory of the Boot Image using ImageX or DISM. However using the above method does not modify the original Boot Image (boot.wim), so it is the preferred method.
Newly installed Windows OS: Add logging options to the Setup Windows and ConfigMgr task of the Task Sequence (New Computer, Refresh, and Replace scenarios)
Since the ConfigMgr client is always installed as part of a ConfigMgr OSD Task Sequence via the Setup Windows and ConfigMgr task, the MSI properties for CCMSetup can be used to set logging options for the SMSTS.log in the new Windows OS.
To set the SMSTS.log settings in the newly installed Windows OS:
In the example in Step 4 above, the SMSTS.log file size is set to 5MB, log level is set to the most verbose level, the amount of rolled over/historical logs is set to 3, and debug logging has been enabled.
IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is always initialized in WinPE. For this reason, even if extended logging is only needed in the newly installed Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so will result in extended logging not being enabled while the Task Sequence is running and instead will only be enabled AFTER the Task Sequence completes.
Additional Notes
Frank Rojas
Senior Support Escalation Engineer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.