Skip to content

Conversation

aurbroszniowski
Copy link
Member

due to default behaviour change in Logback 1.5 where DEBUG is now the new default

Copy link
Member

@myronkscott myronkscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but don't we need to set the actual versions in the gradle.properties file?

@aurbroszniowski
Copy link
Member Author

This looks good but don't we need to set the actual versions in the gradle.properties file?

Thanks for the comment, I changed the gradle properties file

@aurbroszniowski
Copy link
Member Author

I updated the approach to keep the INFO level for the console and server logs.
Some DEBUG logs appeared before TCLogbackLogging is called, so the best solution I could find was to add a default logback.xml config in the classpath. Since Logback will pick up the first config that is found in the classpath, the user could still pass a custom config if he wants.

Also in

  • TCLogbackLogging.resetLogging() added some code to make sure it reloads the xml config.
  • TCLogbackLogging.redirectLogging() removed the temporary appender once full logging is configured, to avoid duplicate console output
  • updated tests

I built a terracotta 12.0 enterprise kit including these terracotta-core changes and tested manually. The console and server are back to what they were with Logback 1.3, and I could pass my custom logback xml.

Comment on lines +54 to +59

try {
new ch.qos.logback.classic.util.ContextInitializer(loggerContext).autoConfig();
} catch (Exception e) {
ch.qos.logback.core.util.StatusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for inline testing and is an attempt to shutdown everything for the current server/classloader. The next server/classloader should do this automatically.

Comment on lines +132 to +136
Appender<ILoggingEvent> bootstrap = root.getAppender("TC_BASE");
if (bootstrap != null) {
root.detachAppender(bootstrap);
try { bootstrap.stop(); } catch (Exception ignore) {}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want console output going to the output stream provided to bootstrap logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants