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

Update logback.version to v1.3.11 (1.3.x) (patch) #185

Merged
merged 2 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<sonar.organization>dropwizard</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<logback.version>1.3.6</logback.version>
<logback.version>1.3.11</logback.version>
<guava.version>32.0.0-jre</guava.version>
<junit.jupiter.version>5.3.2</junit.jupiter.version>
<assertj.version>3.24.2</assertj.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ch.qos.logback.classic.filter.LevelFilter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggingEvent;
import ch.qos.logback.classic.util.LogbackMDCAdapter;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.spi.LifeCycle;
import ch.qos.logback.core.status.ErrorStatus;
Expand Down Expand Up @@ -37,6 +38,7 @@ class ThrottlingAppenderWrapperTest {
void setup() {
context = new LoggerContext();
context.setName("context-test");
context.setMDCAdapter(new LogbackMDCAdapter());
context.start();

collectingAppender = new CollectingAppender<>();
Expand Down Expand Up @@ -109,7 +111,7 @@ private void runLineTest(final long messageRateNanos, final int lineCount, final
final RateLimiter rateLimiter = RateLimiter.create(limit);
for (int i = 0; i < lineCount; i++) {
rateLimiter.acquire();
final LoggingEvent event = new LoggingEvent();
final LoggingEvent event = newLoggingEvent();
event.setLevel(Level.INFO);
event.setLoggerName("test");
event.setMessage(APP_LOG_PREFIX + " " + i);
Expand Down Expand Up @@ -177,7 +179,7 @@ void testLifeCycle() {
void testDoAppend() {
final ThrottlingAppenderWrapper<ILoggingEvent> wrapper = new ThrottlingAppenderWrapper<>(asyncAppender, 1L, TimeUnit.SECONDS);
wrapper.start();
final LoggingEvent event = new LoggingEvent();
final LoggingEvent event = newLoggingEvent();
wrapper.doAppend(event);
wrapper.stop();

Expand Down Expand Up @@ -293,7 +295,7 @@ void testGetFilterChainDecision() {
wrapper.addFilter(filter);
wrapper.start();

final LoggingEvent event = new LoggingEvent();
final LoggingEvent event = newLoggingEvent();
event.setLevel(Level.DEBUG);

assertThat(wrapper.getFilterChainDecision(event)).isEqualTo(FilterReply.DENY);
Expand All @@ -304,4 +306,10 @@ void testToString() {
final ThrottlingAppenderWrapper<ILoggingEvent> wrapper = new ThrottlingAppenderWrapper<>(asyncAppender, 1L, TimeUnit.SECONDS);
assertThat(wrapper.toString()).isEqualTo("io.dropwizard.logback.ThrottlingAppenderWrapper[async-appender-test]");
}

private LoggingEvent newLoggingEvent() {
final LoggingEvent event = new LoggingEvent();
event.setLoggerContext(context);
return event;
}
}