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
Output changeset execution to UI like rollback does #1932
Conversation
…base into sergeevik-update_log_to_ui
Thanks for the PR! I added a missing space after the : on both the existing rollback and the new update message and updated the branch with the current master code. |
@@ -40,8 +43,12 @@ public Direction getDirection() { | |||
@Override | |||
public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, | |||
Set<ChangeSetFilterResult> filterResults) throws LiquibaseException { | |||
Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database); | |||
if (! (executor instanceof LoggingExecutor)) { | |||
Scope.getCurrentScope().getUI().sendMessage("Running Changeset: " + changeSet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logs directly to stdout or it should respect logging levels? On what level it logs then? I have logging.level.liquibase: WARN
(in Spring Boot's application.properties
) and after update I see all these messages in console as-is, without date/level/class/etc. For example:
2022-01-22 15:02:34.380 [user: ] INFO 18949 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
Running Changeset: liquibase/initial-state.xml::create-users_activation-table::php-coder
Running Changeset: liquibase/initial-state.xml::create-users_table::php-coder
Running Changeset: liquibase/initial-state.xml::create-countries-table::php-coder
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be related to my dated Spring Boot version, so I'm not fully sure whether it's a bug in Liquibase..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional observation: these messages appears also when I run unit tests that use H2 :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on this one. We have a few hundreds of change logs and thousands of tests. Imagine how messy build logs are now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment
Liquibase Version: 4.4.0
Liquibase Integration & Version: CLI
Pull Request Type
Description
When use rollback command cli, i see in terminal this log:
But when use update, i see only:
PS.. use 4.4.0 version have same result:
With this change. log looks like:
Fast Track PR Acceptance Checklist:
Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Ran new code to see additional messages on update