If you’re developing client side code for Creatio viewing information about what is happening at runtime is easy since you can output anything to the console. If you’re developing C# code, or need to debug C# code – even in a cloud hosted system, the best approach is to use a logger.
We can use a logger to log info, error, etc messages. To view these messages, we’ll use Clio Explorer, which is an add-on for Visual Studio Code.
Using the log viewer built-into Clio Explorer we can view our logging information in real time, as things occur. The end result will be viewing logging messages like this:

In the image above, notice the message from “CfxLogger” that reads “Testing at 2/23/2024 11:59:39 PM”. That message was received from C# code running in Creatio as it was happening. Meaning, the logging message appeared just as the information was logged.
To use logging in your C# code in Creatio, you’ll need to include a using statement for the following namespace:
global::Common.Logging
If your C# code is in a script task in a process, be sure to add that in the methods tab of the process properties.

With that added we can add logging messages. First, we must create a logger. In the sample below I am giving my logger a name. This name can be anything. Having a unique name gives you something specific to look for in the logging output.
var logger = LogManager.GetLogger("CfxLogger");
With the logger created we can use the Info, Error, Warn etc functions to add logging messages of different types. This name is what we’ll use to listen for messages from in VSCode/Clio Explorer.
//create the logger
var logger = LogManager.GetLogger("CfxLogger");
// log an info message
logger.Info("This is my test info message");
// log an error
logger.Error("Something bad happened!");
// log a warning
logger.Warn("Something sort of bad happened.");
Now, when this runs the information can be views using Clio Explorer. In Clio Explorer click the ellipsis button for the environment and then select logs.

Enter your logger name and click Start to begin listening for the messages and you’ll see them appear as they occur.
Alternatively, instead of using Clio Explorer, you can use the Telemetry Log from the Creatio marketplace to listen for the messages.




How do you configure the logging level for this, both in a local instance and a cloud instance? Is it configurable on the fly, or does it require restarting? And can the log levels be set per-logger, or is it for all loggers in the system?
Comments from Creatio support on this:
The logging level can be changed in the site configuration files, and it does not require a restart. It can be modified at any time without affecting users, by submitting a request to the support team.
Log level on local env can be adjusted by adding string with your Logger name into nlog.config block (for cloud instances it would be nlog.cloud.config)
The nlog.config file can be found in the Terrasoft.WebApp directory of local instances, and some Creatio documentation on the logger can be found here: https://academy.creatio.com/docs/developer/development_tools/logging/nlog/overview