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 support for multiple Markers attached to a single LoggingEvent #840

Conversation

brenuart
Copy link
Collaborator

ILoggingEvent can have multiple markers associated with them since Logback 1.3. To support this new behavior, a new ILoggingEvent#getMarkerList() method has been introduced. This change retrieves the Marker by calling this new method instead of the former #getMarker().

Test case have been adapted consequently. Also, tests have been modified to use concrete instances of LoggingEvent instead of mocking the used methods. This way we don’t make any assumption anymore about the actual behaviour of the LoggingEvent.

closes #831

ILoggingEvent can have multiple markers associated with them since Logback 1.3. To support this new behavior, a new ILoggingEvent#getMarkerList() method has been introduced. This change retrieves the Marker by calling this new method instead of the former #getMarker().

Test case have been adapted consequently. Also, tests have been modified to use concrete instances of LoggingEvent instead of mocking the used methods. This way we don’t make any assumption anymore about the actual behaviour of the LoggingEvent.
@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #840 (c3bc6f3) into main (a6745de) will decrease coverage by 0.10%.
The diff coverage is 80.76%.

@@             Coverage Diff              @@
##               main     #840      +/-   ##
============================================
- Coverage     70.90%   70.80%   -0.11%     
- Complexity     1258     1261       +3     
============================================
  Files           168      168              
  Lines          4816     4829      +13     
  Branches        502      505       +3     
============================================
+ Hits           3415     3419       +4     
- Misses         1153     1156       +3     
- Partials        248      254       +6     
Impacted Files Coverage Δ
...site/loggingevent/LogstashMarkersJsonProvider.java 85.00% <75.00%> (-15.00%) ⬇️
...gback/composite/loggingevent/TagsJsonProvider.java 89.65% <83.33%> (-10.35%) ⬇️
...ogback/composite/loggingevent/MdcJsonProvider.java 84.44% <0.00%> (-2.23%) ⬇️
...ck/appender/AbstractLogstashTcpSocketAppender.java 69.23% <0.00%> (-0.52%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@brenuart brenuart merged commit cdec289 into main Aug 16, 2022
@brenuart brenuart deleted the 831-add-support-for-multiple-marker-instances-on-a-single-logging-event-slf4j-200 branch August 16, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for multiple Marker instances on a single logging event (SLF4J 2.0.0)
2 participants