0

I'm using Sitecore 9.0.1. I would like to replace log4net with Serilog.

How do I configure it for 9.0.1?

1

1 Answer 1

0

We are using Serilog in our Sitecore 9.0.3 project. It works great. One way of achieving this is shown here:

http://andrewsutherland.azurewebsites.net/2019/09/02/sitecore-experience-commerce-improved-serilog-configurations/

It's basically using Serilog and Serilog.Sinks.File NuGet packages.

If you don't like to do the startup.cs way, you can inject a Serilog initialization class after "Sitecore.Mvc.Pipelines.Loader.InitializeDependencyResolver" using the patch config and initialize the Log.Logger = new LoggerConfiguration() as shown in the above url using all the required settings from another config file.

And while using Serilog. Use it like this: using Log = Serilog.Log;

Log.Information(), Log.Warning(), Log.Error(), and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.