Orcus Server with verbose output in console

With the new logging system introduced in Orcus 1.9, log messages can contain a lot more details which makes it a lot easier to find problems and resolve them. The logging behavior can be modified by editing the file NLog.config from the Orcus Server directory.

Technical stuff

You can find a detailed documentation on the offical GitHub site of Nlog: https://github.com/nlog/NLog/wiki/Configuration-file

The part we will focus in this article on are the four lines which introduce a variable:

  <variable name="VerboseLayout" value="${longdate:padding=4} ${level:upperCase=true:padding=-6}  [${logger:shortName=false} -&gt; ${threadname}] ${message} (${callsite:includSourcePath=false}) ${exception:format=ToString}" />
  <variable name="ConsoleLayout" value="${longdate:padding=4} ${level:upperCase=true:padding=-6}  [${logger:shortName=true:padding=-12}] ${message}" />
  <variable name="TextBoxLayout" value="${date:format=HH\:MM\:ss.ffff} [${level:upperCase=true}]&#009;[${logger:shortName=true}] ${message}" />
  <variable name="MinLogLevel" value="Info" />

The variables define how the log lines should look like and what should be included. You can find a complete list of all possible “layout renderers” here. As an example, ${message} defines the core message, ${longdate} is the date when the log line was created.

And what should I do now?

A really important part of logging are the log levels. NLog/Orcus has the log levels (Fatal, Error, Warn, Info, Debug) (as you also can see here). To make the logging in the console more verbose, you can just change the line

<variable name="MinLogLevel" value="Info" />


<variable name="MinLogLevel" value="Debug" />

As you can see, we changed the Minimum Log Level to Debug which makes the console display all previous messages plus the messages on debug level.

To increase verbosing to a maximum, you can also add more information to a log line as already stated in the technical stuff. As you can see in the log file, the logging to the file log.txt uses the verbose logging variable which is a predefined pattern which includes most important aspects. That results in a huge log.txt file size but also a lot of important information so you can trace every action the server made. You can also change the pattern of the ConsoleLayout (for Console Server) or TextBoxLayout (for GUI server). You can as an example just copy the value from VerboseLayout to the ConsoleLayout.

Restore the default NLog.config

If you made a mistake and the server is not starting anymore or you just want to restore the default behavior, you just have to delete the file NLog.config and the default version will be created on a restart.

Facebook like

Subscribe to our e-mail newsletter to receive updates.
Comments are closed.