Comments (19)
I guess this means v8 is done then 😄😄
from elmah.io.umbraco.
@sitereactor Do you know if there is a better way to listen for 404s?
from elmah.io.umbraco.
@zpqrtbnk would be a better fit for answering this. I'm not all that familiar with the possibilities in the ContentFinders. But I'm sure Stephane would be able to answer this.
from elmah.io.umbraco.
Hi,
I'm assuming that there is no update on this unfortunately?
Nik
from elmah.io.umbraco.
No update. Maybe Umbraco 8 will have some improvements for this @zpqrtbnk?
from elmah.io.umbraco.
If Umbraco doesn't support this, an option would be to make elmah.io's LastChanceContentFinder configurable. This way you could decide which package to use. 404s wouldn't be logged to elmah.io though.
from elmah.io.umbraco.
Now is not a good time to get a response from Stephane. He has more then enough on his plate with the upcoming v8 release, so I would suggest to try again in a month.
Sorry!
from elmah.io.umbraco.
That would be really useful to have it configurable as I'd rather have the custom 404 working than the 404 tracking in Elmah.io :-) It might be a case that I end up trying to create my own content finder that does both the 404 and then calls the Elmah.io code although I'm not sure. Just we keep getting complaints when the Elmah.IO stops the custom 404s from showing :-)
from elmah.io.umbraco.
Oops wasn't paying attention to this - Umbraco 8 composers can be ordered and register one after another... but... do I understand that elmah tracks 404 but handling them (as in, last chance finder)? meaning, you just cannot have another last chance finder?
then... what about elmah registering a normal finder at the last position, that would track the 404 but return it cannot find content, so that ppl last chance finder can still kick in?
from elmah.io.umbraco.
You might be able to do something like this:
- Install
Elmah.Io.WebApi
. - Add the
ElmahExceptionLogger
:
GlobalConfiguration.Configuration.Services.Add(typeof(IExceptionLogger), new ElmahExceptionLogger());
-
Add
elmah.io.log4net
. -
Add the elmah.io.log4net config: https://github.com/elmahio/elmah.io.umbraco/blob/master/elmah.io.umbraco/NuGet/content/Config/log4net.config.install.xdt
-
Implement your own
IContentFinder
:
public class CustomPageNotFoundContentFinder : IContentFinder
{
public bool TryFindContent(PublishedContentRequest contentRequest)
{
if (contentRequest.Is404)
{
ErrorSignal.FromCurrentContext().Raise(new HttpException(404, "Page not found"));
}
return new PageNotFoundContentFinder().TryFindContent(contentRequest);
}
}
from elmah.io.umbraco.
@sitereactor No worries, Morten. Sounds like U8 may be slightly more important than supporting multiple content finders 😂
from elmah.io.umbraco.
mmm, but I did reply !
from elmah.io.umbraco.
@zpqrtbnk elmah.io registers itself as a ContentLastChanceFinder
, yes: https://github.com/elmahio/elmah.io.umbraco/blob/master/elmah.io.umbraco/ElmahIoApplicationEventHandler.cs#L14. I wasn't aware that there were other ways to listen for 404s? At least not <U8.
from elmah.io.umbraco.
elmah.io's IContentFinder
returns false
(https://github.com/elmahio/elmah.io.umbraco/blob/master/elmah.io.umbraco/ElmahIoApplicationEventHandler.cs#L29), but in the case where UmbracoPageNotFoundManager runs first, elmah.io's content finder is never invoked.
from elmah.io.umbraco.
@NikRimington Does the solution proposed in this comment solve your problem? I think we will need to re-implement this for Umbraco 8 anyway since the API has been changed.
from elmah.io.umbraco.
Hi @ThomasArdal , I've not had a chance to test it but it sounds like it should do as long as I can ensure that it is the last content finder to run before the 404 handler.
Just to confirm, I'd have to uninstall the "Elmah.IO.Umbraco" nuget right? Which is why I'd have to manually run the xdt for Log4Net you mentioned as that and the content finder are the only two actions that the pack performs correct?
from elmah.io.umbraco.
@NikRimington You will need to uninstall Elmah.Io.Umbraco
, yes. That package contains the last change content finder and automatically add it on startup. You can copy the log4net config you already have to re-use after uninstall. There is more help for log4net here: https://docs.elmah.io/logging-to-elmah-io-from-log4net/.
from elmah.io.umbraco.
Okay, so I've been testing this over the last day or so and I've been able to use the ideas discussed here to get something that appears to work. What I'm actually doing is creating my own content finder that at start up is injecting itself at the very end of the ContentFinder lists and not as the last chance finder. This appears to work nicely :-)
from elmah.io.umbraco.
Good to hear that, Nik. I'll go ahead and close this issue then. Hoping to do something better for Umbraco 8, once I find a good alternative to content finders there.
from elmah.io.umbraco.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmah.io.umbraco.