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

CORE-3220 print detailed output when using logLevel INFO or greater #770

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public static int run(String[] args) throws LiquibaseException {
}

main.applyDefaults();
main.changeLogLevel();
main.configureClassLoader();
main.doMigration();

Expand Down Expand Up @@ -249,6 +250,25 @@ protected static void setupLogging() {
}
}

/**
* Change the logging based on the parsed value of logLevel
*/
protected void changeLogLevel() {
if ("off".equals(logLevel)) {
return;
}

Level newLevel = Level.toLevel(logLevel);

ch.qos.logback.classic.Logger root =
(ch.qos.logback.classic.Logger) LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
root.setLevel(newLevel);

if (Level.INFO.isGreaterOrEqual(newLevel)) {
consoleLogFilter.outputLogs = true;
}
}

/**
* Warns the user that some logging was suppressed because the --logLevel command line switch was not set high
* enough
Expand Down