Skip to content

Commit

Permalink
LoggingBootstrap > formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Remit authored and A-Imal committed Dec 13, 2023
1 parent c3837c9 commit 526b49b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/main/java/com/hivemq/bootstrap/LoggingBootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public static void prepareLogging() {

final ch.qos.logback.classic.Logger logger = getRootLogger();


final Iterator<Appender<ILoggingEvent>> iterator = logger.iteratorForAppenders();
while (iterator.hasNext()) {
final Appender<ILoggingEvent> next = iterator.next();
Expand All @@ -70,20 +69,17 @@ public static void prepareLogging() {
defaultAppenders.add(next);
}


//This appender just adds entries to an Array List so we can queue the log statements for later
listAppender = new ListAppender<>();
listAppender.start();
logger.addAppender(listAppender);

}

/**
* Initializes all Logging for HiveMQ. Call this method only once
* at the very beginning of the HiveMQ lifecycle
*/
public static void initLogging(final @NotNull File configFolder) {

final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();

context.addListener(logbackChangeListener);
Expand Down Expand Up @@ -117,7 +113,6 @@ public static void resetLogging() {
* Re-enables all default appenders that were removed from the root logger for startup
*/
private static void reEnableDefaultAppenders() {

final ch.qos.logback.classic.Logger logger = getRootLogger();

for (final Appender<ILoggingEvent> defaultAppender : defaultAppenders) {
Expand All @@ -129,7 +124,6 @@ private static void reEnableDefaultAppenders() {
* Logs all queued Entries to the logger. It is assumed that the logger is fully initialized at this point
*/
private static void logQueuedEntries() {

final ch.qos.logback.classic.Logger logger = getRootLogger();

listAppender.stop();
Expand Down

0 comments on commit 526b49b

Please sign in to comment.