To change the detail level of the log messages or any other aspect of logging, modify the NLog.config file.
By default, the log level is set to Warn
, which means that warnings, as well as critical and non-critical errors, are logged.
Procedure
- On the Content Manager server machine, go to the following location: %Tridion_Home/web/WebUI/WebRoot/bin
- Open NLog.config for editing in a plain-text or XML editor.
- Locate the
<logger name="*"/>
element and add a new logger name that writes to "fileTarget", then change the value of minlevel
attribute to one of the following values (eg: Debug): -
<rules>
<logger name="Tridion.SentinelCloudConnect.Client.Logger" minlevel="Warn" writeTo="sentinelCloudConnectFileTarget" final="true" />
<logger name="*" minlevel="Warn" writeTo="eventlog" />
<logger name="*" minlevel="Debug" writeTo="fileTarget" />
</rules>
Log Level | Description |
---|
Trace | For tracing the program flow and performing the finest level of debugging–logs messages with the highest level of detail about the application's lowest-level activity. |
Debug | For normal debugging–logs fine-grained messages about low-level functionality being executed, intended to discover the source of a problem. |
Info | Logs information messages related to normal activity and user behavior, plus all warnings and errors. |
Warn | Logs warnings of unexpected events as well as all errors. |
Error | Logs all errors–both fatal events and non-fatal errors. |
Fatal | Logs only critical errors, that is, events that cause the system to go down. |
For more information on all NLog settings, refer to the NLog documentation on log levels. - By default, log messages are logged both to console and to file, and the file target is a rolling log, producing a new file every 1,000,000 bytes.You can modify this behavior by changing the following settings:
-
- Logging locations
- Log file names
- Log message format
For more information on all NLog settings and features, refer to the NLog configuration file documentation.
- To debug issues specific to Content Manager, and a new <"target
">
element with a "name" matching the "writeTo" element from the previous step and specify the location and name within the fileName parameter: -
<targets>
<target xsi:type="File"
name="sentinelCloudConnectFileTarget"
archiveAboveSize="1000000"
fileName="${environment:TRIDION_HOME}/log/SCC/${processname}_${shortdate}.log"
bufferSize="4096"
keepFileOpen="true"
autoFlush="false"
openFileFlushTimeout="10"
layout="${longdate}|${level:uppercase=true}|${processid}|${event-properties:item=component}|${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=10}"/>
<target xsi:type="EventLog"
name="eventlog"
source="Tridion ${event-properties:category}"
log="Tridion"
layout="${message}${newline}${newline}Component: ${logger}${newline}Errorcode: ${event-properties:errorcode}${newline}User: ${windows-identity}${newline}${newline}${exception:format=ToString}"/>
<target xsi:type="File"
name="fileTarget"
archiveAboveSize="1000000"
fileName="c:/logs/NLog/${processname}_${shortdate}.log"
bufferSize="4096"
keepFileOpen="true"
autoFlush="false"
openFileFlushTimeout="10"
layout="${longdate}|${level:uppercase=true}|${processid}|${event-properties:item=component}|${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=10}"/>
</targets>
- Save and close NLog.config.