Skip to content
Snippets Groups Projects
Unverified Commit e12bb057 authored by Lukas Lechner's avatar Lukas Lechner Committed by GitHub
Browse files

Improve log censoring mechanics (EXPOSUREAPP-7455, EXPOSUREAPP-7196, EXPOSUREAPP-7514) (#3280)


* Catch IndexOutOfBoundsExceptions in the DebugLogger and log out information

* Fix IndexOutOfBoundsException due to censored string bounds exceeding original log message.

* Fix missing censoring if log lines contain the same value multiple times.

* Remove unused code.

* Adjust CensoredString.censor(...) to determine the bounds always on the original.

* Add test for incorrectly censored message due to changed bounds (working with bounds on the censored message, instead of original message).

* Implement internal censoring collision handling within each censoring module.

* Remove superfluous factory method.

* Move the final censor compilation step to the DebugLogger, in case of collisions we don't need to do all the work.
Re-use censor container for "per module" censoring and the "top-level" combination of all modules.

* Adjust censoring for values that need to be censored, but do not overlap, each other, just touch: "<ABC><DEF>".

* LINTs

* Don't pass all meta data to censoring, we only need to censor the line, the metadata can be added later. No unnecessary string work.

* Fix typos and docs.

* Remove coerce as we work only the original.

* Implement equals/hashcode for replacement actions and changed collection from LIST to SET, to prevent collisions due to duplicate replacement actions.

* If a censor throws an exception, censor everything as precaution.

* Fix flaky test.

Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
Co-authored-by: default avatarBMItter <Berndus@gmx.de>
Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
parent ae3a063f
No related branches found
No related tags found
No related merge requests found
Showing
with 445 additions and 216 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment