Skip to content

Commit

Permalink
Updates MdcKeys (DAT-12915) (#3679)
Browse files Browse the repository at this point in the history
* add MDC interfaces and base classes (DAT-12601) (#3567)

Create the basic APIs for MDC in support of structured logging.

* set log format in log service

* add deprecated annotation

* Revert "set log format in log service"

This reverts commit 096b067.

* use log formatter for JSON logging

* add MDC to structured log output

* fix test

* Include "path" in databasechangelog's description column for all change types with "path" attributes (#3244)

Extends the DESCRIPTION column of the DATABASECHANGELOG for sqlFile by the path specification, for example sqlFile path=IUNT200.sql

Co-authored-by: michaelmatthiaskern <michael.kern@mail.de>
Co-authored-by: Nathan Voxland <nathan@voxland.net>

* #1466: Add ignore:true changeset attribute to Formatted SQL changeLogs (#3377)

Co-authored-by: skrivenko <skrivenko@users.noreply.github.com>
Co-authored-by: filipe lautert <flautert@liquibase.org>

* [DAT-12602] Initial update mdc implementation.

* add configuration option for log format

* [DAT-12602] Adds remaining mdc values. Reworks to use static strings over enum.

* [DAT-12602] Remove unused keys, fixed formatting.

* [DAT-12602] Adds system information to mdc.

* [DAT-12602] Fixes formatting for mdckey.

* [DAT-12602] Simplifies getting mdc for command name.

* updated logFormat description

* warn about invalid values for log format

* [DAT-12602] Add changeset outcome to info log, fix deployment outcome to actually show in info.

* Revert "Merge remote-tracking branch 'origin/DAT-11693' into DAT-12602"

This reverts commit 6e9163d, reversing
changes made to 1ceec55.

* Revert "Merge remote-tracking branch 'origin/DAT-12727' into DAT-12602"

This reverts commit 8554e29, reversing
changes made to 10d540b.

* Revert "Revert "Merge remote-tracking branch 'origin/DAT-11693' into DAT-12602""

This reverts commit 10d540b.

* Revert "Revert "Merge remote-tracking branch 'origin/DAT-12727' into DAT-12602""

This reverts commit 12f6539.

* [DAT-12602] Fix liquibase system information mdc.

* [DAT-12602] Fix logged liquibase version.

* [DAT-12915] Replaces liquibaseTargetType/liquibaseTargetUrl with liquibaseTargetUrl and unused liquibaseRefUrl.

* Revert change to build.properties

* safely cast logformat - fixes using the default value

* [DAT-12602] Adds mdc for failed changeset outcome.

Co-authored-by: Steven Massaro <steven.massaro.web@gmail.com>
Co-authored-by: MichaelKern-IVV <102645261+MichaelKern-IVV@users.noreply.github.com>
Co-authored-by: michaelmatthiaskern <michael.kern@mail.de>
Co-authored-by: Nathan Voxland <nathan@voxland.net>
Co-authored-by: skrivenko <72100114+skrivenko@users.noreply.github.com>
Co-authored-by: skrivenko <skrivenko@users.noreply.github.com>
Co-authored-by: filipe lautert <flautert@liquibase.org>
  • Loading branch information
8 people committed Jan 19, 2023
1 parent 53876f4 commit 384f36e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions liquibase-core/src/main/java/liquibase/Liquibase.java
Expand Up @@ -239,8 +239,7 @@ public void update(Contexts contexts, LabelExpression labelExpression, boolean c
runInScope(() -> {
LockService lockService = LockServiceFactory.getInstance().getLockService(database);
lockService.waitForLock();
Scope.getCurrentScope().addMdcValue(MdcKey.OPERATION_TARGET_VALUE, database.getConnection().getURL());
Scope.getCurrentScope().addMdcValue(MdcKey.OPERATION_TARGET_TYPE, MdcValue.URL_DATABASE_TARGET);
Scope.getCurrentScope().addMdcValue(MdcKey.LIQUIBASE_TARGET_URL, database.getConnection().getURL());

changeLogParameters.setContexts(contexts);
changeLogParameters.setLabels(labelExpression);
Expand Down
Expand Up @@ -7,8 +7,8 @@ public class MdcKey {
public static final String CHANGESET_FILEPATH = "changesetFilepath";
public static final String CHANGESET_OUTCOME = "changesetOutcome";
public static final String OPERATION_TYPE = "liquibaseOperation";
public static final String OPERATION_TARGET_TYPE = "liquibaseTargetType";
public static final String OPERATION_TARGET_VALUE = "liquibaseTarget";
public static final String LIQUIBASE_TARGET_URL = "liquibaseTargetUrl";
public static final String LIQUIBASE_REF_URL = "liquibaseRefUrl";
public static final String CHANGESET_OPERATION_START_TIME = "changesetOperationStart";
public static final String CHANGESET_OPERATION_STOP_TIME = "changesetOperationStop";
public static final String CHANGESET_SQL = "changesetSql";
Expand Down

0 comments on commit 384f36e

Please sign in to comment.