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

Multiple log messages for single Request with error 404 #81

Closed
klinki opened this issue Mar 6, 2024 · 2 comments
Closed

Multiple log messages for single Request with error 404 #81

klinki opened this issue Mar 6, 2024 · 2 comments

Comments

@klinki
Copy link

klinki commented Mar 6, 2024

Hi,
I'm facing a problem with getting multiple log messages for a single request. One log message with status 404 (correct one) and one with status 200.

More particular, for requests that ends up with error 404 - and even more interestingly, only for request that doesn't end with file extension.

  • /foo/invalid/request.jpg - this works fine, just a single error 404 is logged
  • /foo/invalid/request - this is broken, multiple messages are logged, first one with error 404 and second one with status 200.

Example:

[15:28:12 INF] HTTP GET /file-manager/backend/permissions/a responded 404 in 0ms
Response sent: http://localhost:36700/file-manager/backend/permissions/a with HTTP status 404.0
[15:28:12 INF] HTTP GET /file-manager/backend/permissions/a responded 200 in 22ms

So far I managed to find out ApplicationLifecycleModule.Init is getting called multiple times and also Application.BeginRequest is called multiple times (which results into multiple calls of WebRequestLoggingHandler.OnBeginRequest). Also LogRequest is called multiple times.

I know ASP.NET is bit dated and now world has moved on to ASP.NET Core, but I still have few old projects to support until we can figure out migration to ASP.NET Core :(

@tsimbalar
Copy link
Member

tsimbalar commented Mar 11, 2024

Hey @klinki ,

indeed, not much activity in here ... I can't really do anything to investigate (don't even have access to a Windows machine anymore), but if you can figure something out, maybe we can look for a fix through a PR ...

Maybe something like this is happening ?
https://stackoverflow.com/questions/1140915/httpmodule-init-method-is-called-several-times-why

@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