-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElmahCore in ASPNET Core 7 Web API throws 404 /favicon.ico Not Found error... #172
Comments
These are the errors that YOUR site has raised that were caught by ElmahCore. If your site doesn't have a favicon.ico browsers automatically try to load one when they go to a domain. which will raise a 404 error. Do you really want to log all 404 errors?
|
@afastrunner - thank you, I did not say ElmahCore was the issue, but trying to understand. I don't maintain the source code for the route .../elmah/errors. The is a generated route from the ASPNET Core config. It appears that the /elmah/errors route is attempting to reference favicon.ico from its generated Elmah log error user interface that is shown the original posting. Can you explain how or where the ElmahCore admin interface is generated from? |
when your browser goes to localhost:7065/elmah/errors the browser says to it's self "lets see if this domain localhost has a favicon.ico I can display in the browser tab and requests it from /favicon.ico" the /favicon.ico request starts with / so it's made to the root application localhost:7065/favicon.ico which is your application, the static file middleware there says "nope I don't have favicon.ico and raises a 404 exception" elmah middleware sees the 404 exception and logs it's in the interface your seeing. |
@afastrunner - thank you for your time to explain. And that it my understanding of what is going on too, but the confusion comes from the fact that dropping a favicon on the root of localhost:7065 had no affect when I tried before submitting this issue to GitHub. Plus I never realized that a browser always tries request a favicon.ico even if there isn't page containing meta data link/referencing one. Surprised I've never ran into that. You mention a wwwroot folder, but my root are just libraries and does not have wwwroot. I guess I give that a try |
Yeah if it's WebAPI you likely don't have Static files Middleware enabled so putting favicon.ico in your root doesn't serve anything. If it was a MVC/Razor you would have a wwwroot folder and static files middleware serving files from that folder. |
Many thanks for taking the time to help assist with this. Much appreciated! |
ElmahCore implement via NuGet for an ASPNET Core 7 Web API throws the error below.
Anyone have any suggestions on how to correct as for each error received?
Is a favicon missing in ElmahCore source?
The text was updated successfully, but these errors were encountered: