question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable console logs for every changeset

See original GitHub issue

Environment

Liquibase Version: 4.7.1

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>

Liquibase Extension(s) & Version:

Database Vendor & Version:

Operating System Type & Version:

Description

Since 4.7.1 every changeset is logged to SOUT, and it seems like there is no way to turn it off. For us that means that tests logs are complete unusable during to hight amount of tests & changesets.

Steps To Reproduce

Just run the migration.

Actual Behavior

For every change set a message in system out is appeared:

Running Changeset: db/changelog/db.changelog-file.xml::version::author

Expected/Desired Behavior

No message in SOUT. A way to completely replace ConsoleUIService with LoggerUIService so every message could be controlled by logger implementation

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:26
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
bmarwellcommented, Jul 15, 2022

Here’s the reason it appeared:

https://github.com/liquibase/liquibase/commit/26f9eac8d4958455c06c2c6e97c12c19c1666dfd

Those lines are “new”: https://github.com/liquibase/liquibase/commit/26f9eac8d4958455c06c2c6e97c12c19c1666dfd#diff-e48270cbddf72e544cefef4081d2066ece7c1955b433fe7301308b75315c8d1bR46-R49

Before this change, no output was on stdout. Now I have it twice: In my custom logging implementation (liquibase-slf4j) AND on stdout. This happens to all my junit tests.

Can you please re-evaluate this commit?

// Edit:

Workaround for Library users is to use the code directly just before the update instruction:

   try {
        Scope.enter(Map.of(Scope.Attr.ui.name(), new LoggerUIService()));
      } catch (Exception e) {
        log.error("", e);
      }

// Edit 2:

For large projects, the build output (eg Maven builds) get considerably more output. A few hundred lines per test or test class is not something unheard of. The added output can greatly impact build times. It appears out of nowhere after updating the dependency (liquibase). The workaround is surprising at best and needs to be inserted before every update statement.

4reactions
jeenkhoorncommented, Nov 14, 2022

Any updates on a fix for this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to quickly and conveniently disable all console.log ...
Redefine the console.log function in your script. console.log = function() {}. That's it, no more messages to console. EDIT: Expanding on Cide's idea....
Read more >
log-level | Liquibase Docs
The --log-level parameter applies to all Liquibase commands. It can be used to get more information about the actions that Liquibase commands perform, ......
Read more >
How to Disable Console Logging in Spring Boot - Baeldung
Learn how to configure a Spring Boot application so that it does not log to the console, whether it is using Logback, Log4j2, ......
Read more >
Logging and viewing logs | Cloud Run Documentation
Go to the Logs Explorer page in the Google Cloud console: ... Using the drop-down menus, select the resource Cloud Run Revision.
Read more >
sam deploy - AWS Serverless Application Model
Prompt to confirm whether the AWS SAM CLI deploys the computed changeset. --use-json, Output JSON for the AWS CloudFormation template. The default output...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found