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

add liquibaseHostName MDC key (DAT-14956) #4370

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -424,7 +424,9 @@ private void logMdcData() throws IOException {
MdcManager mdcManager = Scope.getCurrentScope().getMdcManager();
try (MdcObject version = mdcManager.put(MdcKey.LIQUIBASE_VERSION, LiquibaseUtil.getBuildVersion());
MdcObject systemUser = mdcManager.put(MdcKey.LIQUIBASE_SYSTEM_USER, System.getProperty("user.name"));
MdcObject systemName = mdcManager.put(MdcKey.LIQUIBASE_SYSTEM_NAME, NetUtil.getLocalHostName())) {
MdcObject systemName = mdcManager.put(MdcKey.LIQUIBASE_SYSTEM_NAME, NetUtil.getLocalHostName());
// The host name here is purposefully the same as the system name. The system name is retained for backwards compatibility.
MdcObject hostName = mdcManager.put(MdcKey.LIQUIBASE_HOST_NAME, NetUtil.getLocalHostName())) {
StevenMassaro marked this conversation as resolved.
Show resolved Hide resolved
Scope.getCurrentScope().getLog(getClass()).info("Starting command execution.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ public class MdcKey {
public static final String DEPLOYMENT_OUTCOME = "deploymentOutcome";
public static final String LIQUIBASE_COMMAND_NAME = "liquibaseCommandName";
public static final String LIQUIBASE_VERSION = "liquibaseVersion";
/**
* Use the {@link MdcKey}#LIQUIBASE_HOST_NAME instead.
*/
@Deprecated
public static final String LIQUIBASE_SYSTEM_NAME = "liquibaseSystemName";
public static final String LIQUIBASE_HOST_NAME = "liquibaseHostName";
public static final String LIQUIBASE_SYSTEM_USER = "liquibaseSystemUser";
public static final String OUTPUT_FILE = "outputFile";
public static final String OUTPUT_FILE_ENCODING = "outputFileEncoding";
Expand Down