Problem/Motivation

#3114122: ExceptionLoggingSubscriber should log 403 access denied reason improved the logged message on 403/access denied exceptions. However, it logs backtrace string which can be quite long and could fill up the database if these errors happen quite often.

Proposed resolution

Since the backtrace string is not displayed in the user interface (admin/reports/dblog), we should be able to remove it and save some space in the database.

Remaining tasks

User interface changes

None.

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3167390-2.patch756 bytesmbovan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Status: Active » Needs review
FileSize
756 bytes

Patch that removes @backtrace_string array element before logging the exception.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Not sure if we need an explicit test for this, but combined with some weird access denied handling that resulted in nested access denied exceptions in our project, this logged 2000+ lines of backtrace for every access denied that almost filled our database disk.

The other option would be to keep and show the backtrace, but I think that would be a bigger change and doesn't really seem necessary.

  • catch committed 0870e19 on 9.1.x
    Issue #3167390 by mbovan, Berdir: ExceptionLoggingSubscriber should not...

  • catch committed 282a7ee on 9.0.x
    Issue #3167390 by mbovan, Berdir: ExceptionLoggingSubscriber should not...
catch’s picture

Version: 9.0.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

hmm I don't think this needs test coverage, it's a scalability issue but not really a functional bug as such.

Committed 0870e19 and pushed to 9.1.x. Thanks! Also cherry-picked to 9.0.x and 8.9.x

  • catch committed 9f9caa6 on 8.9.x
    Issue #3167390 by mbovan, Berdir: ExceptionLoggingSubscriber should not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.