Base solution for your next web application
Open Closed

Replacing Log4Net with Application Insights #12523


User avatar
0
ajayak created

For our production app, we want to remove Log4Net file logging and log directly to Application Insights. I used Microsoft.ApplicationInsights.Log4NetAppender but it is limited in many ways.

How do I replace the following code to use Microsoft.Extensions.Logging.ILoggerFactory for Castle ILogger

//Configure Log4Net logging
options.IocManager.IocContainer.AddFacility<LoggingFacility>(
    f => f.UseAbpLog4Net().WithConfig(_hostingEnvironment.IsDevelopment()
        ? "log4net.config"
        : "log4net.Production.config")
);
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    ajayak created

    https://github.com/aspnetboilerplate/aspnetboilerplate/issues/7045 Logger.Log does not record the log on Application Insight.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)