Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

SerilogWeb.Classic IIS classic mode incompatibility #77

Closed
jsurville opened this issue Sep 16, 2021 · 2 comments
Closed

SerilogWeb.Classic IIS classic mode incompatibility #77

jsurville opened this issue Sep 16, 2021 · 2 comments

Comments

@jsurville
Copy link

Hello,

I am using an app that was working fine with the IIS Classic Mode until I started using Serilog and SerilogWeb.Classic for logging.
Now that the application was deployed in Test environment, I get this exception :

[PlatformNotSupportedException: This operation requires IIS integrated pipeline mode..]
System.Web.HttpApplication.add_LogRequest(EventHandler value) +3674928
SerilogWeb.Classic.ApplicationLifecycleModule.Init(HttpApplication application) +159
System.Web.HttpApplication.InitModulesCommon() +170
System.Web.HttpApplication.InitModules() +71
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +824
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +209
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +113
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +539

Is there any issue with using SerilogWeb.Classic in IIS Classic mode ? Because I cannot change the type of mode (I can change it on local environment but in test or production environment, the IIS pools are set to Classic mode and I can't have it changed)

Thank you for helping me,
Regars

Julien

@tsimbalar
Copy link
Member

Hi @jsurville
It's been a while since I've had to play with IIS .

Because the logging happens as part of the "LogRequest" event of the IIS pipeline

application.LogRequest += (sender, args) =>
{
eventHandler.OnLogRequest(Config);
};

I think this is only exposed in "Integrated mode" .

Long story short, if you can validate that your app works fine in "Integrated mode" , I guess you'd probably want to move it to Integrated mode as well in Test and Prod environments ?

My understanding is that "Classic Mode" is considered deprecated / legacy

@tsimbalar
Copy link
Member

This project is no longer being maintained and we are going to archive the SerilogWeb Repositories.

see:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants