Skip to content
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

Add anti-404 activation strategy service/class #5

Closed
Seldaek opened this issue Apr 23, 2012 · 9 comments
Closed

Add anti-404 activation strategy service/class #5

Seldaek opened this issue Apr 23, 2012 · 9 comments

Comments

@Seldaek
Copy link
Member

Seldaek commented Apr 23, 2012

A simple class that avoids triggering the FingersCrossedHandler on 404 errors would be nice. It should still trigger on other 4xx though. This should be made optional I suppose, unless everyone agrees it's a better default. /cc @stof @schmittjoh @fabpot

@schmittjoh
Copy link
Contributor

I do exclude certain 404's where I know the cause, but not generally all 404s.

Maybe a cookbook entry would be better to allow people to adjust it to their needs.

@Seldaek
Copy link
Member Author

Seldaek commented Apr 23, 2012

Well how do you typically do this? In general all I see in 404s are a bunch of hacking attempts from scanners trying to exploit phpmyadmin leaks and similar.. I don't know if it's possible to exclude all of those, but I usually just increase the level to CRITICAL just to get rid of the 404s, so I wouldn't mind this "dumb" exclusion mode, it would still be an improvement.

@stof
Copy link
Member

stof commented May 16, 2012

@Seldaek does the ActivationStrategy of the FingersCrossedHandler could fit your needs for this or do you expect another feature ? If it is enough, it is simply a documentation issue then.

@Seldaek
Copy link
Member Author

Seldaek commented May 17, 2012

@stof yes I'm talking about the ActivationStrategy, but no I don't think it's just documentation, providing one configured by default means people get those benefits by default and then can more easily tweak it since it'd just be changing the class of the service or pointing to another service. That's just my point of view anyway.

@leek
Copy link

leek commented Sep 5, 2012

👍 for not filling the logs with 404's - or at least providing an easy way to stop it.

@Seldaek
Copy link
Member Author

Seldaek commented Jul 29, 2013

OK this is now possible as:

monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: error
            handler:      nested
            excluded_404s:
                - ^/foo/

@jmauerhan
Copy link

Is there a way to make it just exclude all 404s, not just for a specific url? I can't get this to work.

@Seldaek
Copy link
Member Author

Seldaek commented Aug 12, 2015

Excluding this works for me - ^/

@jmauerhan
Copy link

I tried that, and it didn't work, so must have been something else wrong. I thought that would do it so I just wanted to check. Thanks :)

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

No branches or pull requests

5 participants