Sitecore Commerce logviewing using Log2Console

To view Sitecore logs in Log2Console is pretty easy. SitecoreĀ  Platform is using log4net and you can add an UdpAppender for logging in an external application.

On few blogs is described how to do it:

  2. ( few people described different tools for sitecore logs)

Sitecore Commerce is a .NET Core application, and is using Serilog for log messages.

We will use an external nuget package to send UDP package over the network:

To view the commerce logs in Log2Console we need to follow next steps:

  1. Add a settings in commerce config.json to enable/disable sending UDP packages over the network.


2. Add reference to Serilog.Sinks.Udp nuget package


3. Modify commerce engine to use Serilog.Sink.Udp

The UDP packages are sent on port 7071.

At the end of Startup.cs add next code:

var writeToUdp = false;

//check if writotoUdp is enabled
if (bool.TryParse(Configuration.GetSection(“Serilog:WritetoUDP”).Value, out writeToUdp))
if (writeToUdp)
Log.Logger = new LoggerConfiguration()
.WriteTo.Udp(“localhost”, 7071, System.Net.Sockets.AddressFamily.InterNetwork)

4. Add a log2console receiver, it will work on port 7071.


and commerce logs will appear on Log2console


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s