The Content Manager tracing tool
The Content Manager tracing tool returns detailed information about the activities of (a part of) Content Manager.
Introduction
The Content Manager tracing tool consists of two PowerShell cmdlets to start and stop tracer process:
Start-TcmTracingStop-TcmTracing
On your Content Manager server machine, you can log in as an administrator, open a PowerShell prompt and start or stop the tracing tool.
Before setting up the tracing tool, be aware that trace collection slows down your system and uses up disk space with the uncompressed logs it produces. To prevent overly large logs, write to a circular buffer instead of an ever-growing series of files.
Start tracing
Start-TcmTracing -TraceFile PATH\TO\TRACEFILE
where PATH\TO\TRACEFILE is the full path and filename of the log file you want to write to. Tracing continues until you explicitly stop tracing using the Stop-TcmTracing cmdlet.
Tracing parameters
-PARAMETERNAME PARAMETERVALUE) are:
TraceLevel-
The
TraceLevelparameter determines how much detail to log.Possible values are as follows:Value Meaning ErrorTrace level for error traces InformationalTrace level for informational traces VerboseTrace level for full traces, including method parameter values If
TraceLevelis not defined, the default level isVerbose. TraceKeywords-
The
TraceKeywordsparameter defines the types of trace events to log.Include this parameter as a comma-separated list (enclosed in single quotes) of one or more of the following, orAll, meaning all listed keywords:Keyword Meaning PublicTop-level public operations (such as Core Service or TOM.NET methods) PublicIndirectPublic operations called within other public operation DatabaseOperations performed inside the data access layer ExtensionInvocations of any of the following extensions: - Batch Processor
- Event System
- Resolver
- Renderer
- Mediator
- Workflow execution
InternalAny Content Manager code not covered by the above ExternalAny code in your custom extensions added to the code If
TraceKeywordsis not defined, the default value is:'Public, PublicIndirect, Extensions, External' TraceChannel-
The tracing tool is relevant both for all the Content Manager user interfaces and features you may have installed on top of them. The
TraceChanneldefines the specific sources from which events are fired. Tracing logs events fired by the listed channels only.Include this parameter as a comma-separated list (enclosed in single quotes) of one or more of the following values:Keyword Meaning TcmChannelEvents fired from Content Manager TtmChannelEvents fired from Topology Manager TMChannelEvents fired from Translation Manager XpmChannelEvents fired from Experience Manager ECLChannelEvents fired from External Content Library If not defined, the default value is all values:
'TcmChannel, TtmChannel, ECLChannel, TMChannel, XpmChannel' ProcessNames-
The
ProcessNamesparameter defines specific processes to trace.Include this parameter as a comma-separated list (enclosed in single quotes) of one or more of the following values:Value Meaning TcmBatchProcessorThe Batch Processer Windows process, which hosts batch invokers (an extension point) TcmPublisherThe Publisher Windows process for various (but not all) publishing functionality TcmSearchIndexerThe Search Indexer process TcmServiceHostThe Tridion Sites Service Host Windows process (which hosts net.tcpCore Service bindings)TcmWorkflowAgentThe process that hosts automated Workflow Activities TmServiceThe Translation Manager service W3WPThe IIS Worker Process that hosts HTTP-based bindings for the Core Service and Core Service.REST APIs If is not defined, the default value is: (All processes)
TraceFileFormat-
The
TraceFileFormatparameter defines the file format of the log file being produced.Possible values are as follows:Value Meaning TextPlain-text format EtlMicrosoft Event Trace Log file (binary format). If you use this value, TraceFilemust have a value ending in.etl.If is not defined, the default value is
Text. CircularSizeMb-
The
CircularSizeMbparameter defines the maximum size of the circular buffer to which events are logged, in megabytes.Possible values are:- any integer larger than 0
0— do not use a circular buffer; the default when parameter is not defined
TheCircularSizeMbparameter is ignored in the following cases:TraceFileFormatis not set toEtl.MultifileSizeMbis set at all.
MultifileSizeMb-
The
MultifileSizeMbparameter defines the maximum size of log files, in megabytes.Possible values are:- any integer larger than 0
0— no maximum file size; the default when parameter is not defined
Log files are sequentially numbered. For example, if the filename you specify in
TraceFileis foo.log, the files will be called foo001.log, foo002.log and so on.The
MultifileSizeMbparameter is ignored in the following cases:TraceFileFormatis not set toEtl.CircularSizeMbis set to a value other than 0.
Stop tracing
To stop all tracing processes, run the following command:
Stop-TcmTracing
If multiple tracing processes are running and you want to stop only one or some of them, find the process ID of a specific tracing process in the Windows Performance Monitor tool (which you can open by entering the perfmon command in your Windows Start menu), under . Your tracing processes have an ID sdlSession_NUMBER, where NUMBER is a series of digits.
To stop only the process with ID sdlSession_NUMBER, right-click the item in the list and select Stop, then Delete, from the context menu, or alternatively, run the following PowerShell cmdlet:
Stop-TcmTracing -Id NUMBER
Close tracing sessions
You can use the Close-TcmTracingSessions command to view active trace sessions and to optionally delete any orphan sessions that might exist.
To view active trace sessions, run the following command:
Close-TcmTracingSessions
Running the command produces a list of all active trace sessions along with each session's associated client process (identified by its PID, or process ID).
The output also identifies the number of orphaned sessions and asks whether or not you want to close them.
Tracing help
The tool includes help for all parameters and also includes a number of examples. To get help, run the PowerShell cmdlet get-help, as the following example illustrates:
get-help Start-TcmProfiler -detailed
This example uses the detailed parameter. You can, however, use any of the standard PowerShell parameters.