Logging to console
By default, the Publisher (including any C# fragment or .NET assembly Template Building Block involved in the publish action) logs to the Windows Event Log. You can configure the Publisher to also log messages to the console from which you run the Publisher.
Procedure
- On the Content Manager server machine, access the bin\ subfolder of
%TRIDION_HOME% - In this folder, open the file TcmPublisher.exe.config in a plain-text or XML editor. Find the following element:
configuration > loggingConfiguration > categorySources. Within this element, find anaddelement that has itsValueattribute set to the valueTridion.ContentManager.Templating.TemplatingLoggingCategory. - Inside the
listenerssubelement of this element, remove the comment delimiters around the line:<!--add name="Tridion Console Trace Listener" /-->so that it reads
<add name="Tridion Console Trace Listener"/> - Save and close the TcmPublisher.exe.config file.
- The C# fragment or .NET assembly now writes log messages to a command prompt console in which the Publisher runs.Note: the Publisher itself also logs its messages to this console.Your next step is to run the Publisher in debug mode in a command prompt console.
- From the Windows Administrative Tools, access Services, and locate the service called Tridion Content Manager Publisher. Stop this service.
- Start a Windows Command Prompt and navigate to the bin\ subfolder of
%TRIDION_HOME%. - Enter the following command to start the Publisher in debug mode:
TcmPublisher.exe -debug - Whenever you publish an item, the console now displays all messages produced by C# fragment Template Building Blocks and/or .NET Template Building Blocks that are executed as part of publishing the item.