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

Liquibase OFF log level gets logged as ERROR #20

Closed
chwatts opened this issue Nov 18, 2024 · 5 comments
Closed

Liquibase OFF log level gets logged as ERROR #20

chwatts opened this issue Nov 18, 2024 · 5 comments
Assignees
Labels

Comments

@chwatts
Copy link

chwatts commented Nov 18, 2024

This has come to light with the new Liquibase release where analytics are being sent to them. If you turn this off, then this line gets logged:

log.log(LOG_LEVEL.getCurrentValue(), "User has disabled analytics.", null);

From the class AnalyticsArgs. LOG_LEVEL is by default OFF. OFF intValue is MAX_INT, which when processed by this logic:

public void log(Level level, String message, Throwable e) {
    int levelValue = level.intValue();
    if (levelValue <= TRACE_THRESHOLD) {
        this.logger.trace(message, e);
    } else if (levelValue <= DEBUG_THRESHOLD) {
        this.logger.debug(message, e);
    } else if (levelValue <= INFO_THRESHOLD) {
        this.logger.info(message, e);
    } else if (levelValue <= WARN_THRESHOLD) {
        this.logger.warn(message, e);
    } else {
        this.logger.error(message, e);
    }

Results in an error log, which is not what you want. (TRACE_THRESHOLD is 300).

@mattbertolini mattbertolini self-assigned this Nov 19, 2024
@mattbertolini
Copy link
Owner

mattbertolini commented Nov 19, 2024

Hi @chwatts. Thanks for the report. It's not how I would have coded the logging in AnalyticsArgs but 🤷‍♂️. Definitely uncovered a bug.

I've published 5.1.0-SNAPSHOT to the Maven Central Snapshot repository if you want to try it out to see if it fixes your problem. I have PR #21 set up to fix this issue.

@chwatts
Copy link
Author

chwatts commented Nov 19, 2024

hi @mattbertolini Thanks so much for the quick fix here! I can't figure out how to download the snapshot, but looking at your PR changes and test, it looks like it will definitely fix it.

@mattbertolini
Copy link
Owner

@chwatts I've pushed version 5.1.0 to Maven Central. It will probably take an hour or two for it to show up in the repo. Let me know if this fixes the issue.

@chwatts
Copy link
Author

chwatts commented Nov 20, 2024

@mattbertolini This has indeed fixed the issue. Amazing service, thanks so much for being so quick to respond and fix. It is very much appreciated.

@mattbertolini
Copy link
Owner

@chwatts Happy to help! Glad it fixed your issue.

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

No branches or pull requests

2 participants