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

Make AbstractJsonPatternParser throw an exception for invalid pattern instead of logging an ERROR status #691

Merged
merged 14 commits into from
Nov 8, 2021

Commits on Oct 29, 2021

  1. Refactor PatternLayout support

    - PatternLayoutBase creates a new StringBuilder for every event it must serialize causing garbage and  unnecessary pressure on the GC. Try to reuse a StringBuilder per thread.
    - Filtering of empty fields is getting values multiple times from the event which becomes expensive when the value is computed by a PatternLayout. Use Jackson's FilteringJsonGenerator instead.
    - Make use of the most appropriate JsonGenerator#write() method instead of using writeObject() for "simple" value types. Using writeObject() delegates to the underlying ObjectCode which is slower and produces lot more garbage.
    - Refactor the code to make it easier to read and understand.
    brenuart committed Oct 29, 2021
    Configuration menu
    Copy the full SHA
    ec2653e View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2021

  1. Configuration menu
    Copy the full SHA
    9286758 View commit details
    Browse the repository at this point in the history
  2. Suppress DelegatingNodeWriter

    DelegatingNodeWriter is private and used only by OmitEmptyFieldWriter. Suppress the class and move the delegate field directly into the sub-class.
    brenuart committed Oct 31, 2021
    Configuration menu
    Copy the full SHA
    92464dd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    666d169 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2021

  1. Make AbstractJsonPatternParser throw an exception for invalid pattern…

    …s instead of logging an ERROR status
    
    AbstractJsonPatternParser now throws a JsonPatternException in case of invalid pattern. It is up to the AbstractPatternLayoutJsonProvider to catch the exception, log an error status and decide how it should behave.
    
    Invalid PatternLayout formats are now detected and throw a JsonPatternException as well. Detection is done by configuring the PatternLayout instances with a custom Logback context that throws an exception when an ERROR status is logged.
    
    The former implementation used to ignore fields with an invalid pattern layout while keeping the other. This results in a partial JSON output with only the valid fields. This behaviour is now changed and the provider reverts to producing nothing in case of bad configuration.
    
    These changes address issue #686.
    brenuart committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    414f482 View commit details
    Browse the repository at this point in the history
  2. Revert "Make AbstractJsonPatternParser throw an exception for invalid…

    … patterns instead of logging an ERROR status"
    
    This reverts commit 414f482.
    This changes will be committed in a separate branch.
    brenuart committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    ba346a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5a8eec2 View commit details
    Browse the repository at this point in the history
  4. Make AbstractJsonPatternParser throw an exception for invalid pattern…

    …s instead of logging an ERROR status
    
    AbstractJsonPatternParser now throws a JsonPatternException in case of invalid pattern. It is up to the AbstractPatternLayoutJsonProvider to catch the exception, log an error status and decide how it should behave.
    
    Invalid PatternLayout formats are now detected and throw a JsonPatternException as well. Detection is done by configuring the PatternLayout instances with a custom Logback context that throws an exception when an ERROR status is logged.
    
    The former implementation used to ignore fields with an invalid pattern layout while keeping the other. This results in a partial JSON output with only the valid fields. This behaviour is now changed and the provider reverts to producing nothing in case of bad configuration.
    
    These changes address issue #686.
    brenuart committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    670d334 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    35759d0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2f980a0 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2021

  1. Add missing @OverRide

    brenuart committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    a9fc7be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9bffffe View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2021

  1. Configuration menu
    Copy the full SHA
    0930779 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2021

  1. Make 'operation' a standard java Function accepting a String as input.

    - Make 'operation' a standard java Function accepting a String as input.
    - Build the LayoutValueGetter outside of the operation factory
    brenuart committed Nov 8, 2021
    Configuration menu
    Copy the full SHA
    38aeadb View commit details
    Browse the repository at this point in the history