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

Do not log "invalid request token" exceptions #1139

Closed
leofeyer opened this issue Oct 11, 2017 · 7 comments
Closed

Do not log "invalid request token" exceptions #1139

leofeyer opened this issue Oct 11, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@leofeyer
Copy link
Member

@contao/developers How can we stop certain exceptions such as "invalid request token" from cluttering up the log files?

@leofeyer leofeyer added this to the 4.5.0 milestone Oct 11, 2017
@aschempp
Copy link
Member

@leofeyer
Copy link
Member Author

You mean a hardcoded list? What if someone wants to add more entries?

@aschempp
Copy link
Member

We could make it configurable in the bundle. But how would you prevent logging in a regular Symfony application?

@leofeyer
Copy link
Member Author

leofeyer commented Nov 8, 2017

The more I think about it, I come to the conclusion that we should only log unknown exceptions.

Do not log the known exceptions:

    private static $mapper = [
        ForwardPageNotFoundException::class => 'forward_page_not_found',
        IncompleteInstallationException::class => 'incomplete_installation',
        InsecureInstallationException::class => 'insecure_installation',
        InvalidRequestTokenException::class => 'invalid_request_token',
        NoActivePageFoundException::class => 'no_active_page_found',
        NoLayoutSpecifiedException::class => 'no_layout_specified',
        NoRootPageFoundException::class => 'no_root_page_found',
    ];

And do not log the back end exceptions, because both the known exceptions and the back end exceptions are primarily user error which provide little value when added in the log file, don't you think?

@leofeyer
Copy link
Member Author

leofeyer commented Nov 8, 2017

Well, we should log the ForwardPageNotFoundException::class exception, because this is a configuration error that needs to be fixed.

@Toflar
Copy link
Member

Toflar commented Nov 8, 2017

I agree, only ForwardPageNotFoundException is really relevant here.

@leofeyer
Copy link
Member Author

leofeyer commented Nov 8, 2017

Implemented in f72251f.

@leofeyer leofeyer closed this as completed Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants