diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java index cea32299434..dc1c78f7e9e 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java @@ -72,6 +72,17 @@ public class LoggingOptions { .description("Indicates whether to log asynchronously to all handlers.") .build(); + public static final Option LOG_SERVICE_NAME = new OptionBuilder<>("log-service-name", String.class) + .category(OptionCategory.LOGGING) + .description("Set the 'service.name' field in JSON log entries for all log handlers.") + .defaultValue("keycloak") + .build(); + + public static final Option LOG_SERVICE_ENVIRONMENT = new OptionBuilder<>("log-service-environment", String.class) + .category(OptionCategory.LOGGING) + .description("Set the 'service.environment' field in JSON log entries for all log handlers. In ECS format, defaults to the Quarkus profile if not set.") + .build(); + public enum Output { DEFAULT, JSON; diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java index 159b9182ca6..e071a868f79 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java @@ -34,6 +34,7 @@ import static org.keycloak.config.LoggingOptions.LOG_SYSLOG_ENABLED; import static org.keycloak.quarkus.runtime.configuration.Configuration.isSet; import static org.keycloak.quarkus.runtime.configuration.Configuration.isTrue; import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.fromOption; +import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.fromParentOption; public final class LoggingPropertyMappers implements PropertyMapperGrouping { @@ -54,6 +55,12 @@ public final class LoggingPropertyMappers implements PropertyMapperGrouping { .build(), fromOption(LoggingOptions.LOG_ASYNC) .build(), + fromOption(LoggingOptions.LOG_SERVICE_NAME) + .paramLabel("name") + .build(), + fromOption(LoggingOptions.LOG_SERVICE_ENVIRONMENT) + .paramLabel("environment") + .build(), // Console fromOption(LoggingOptions.LOG_CONSOLE_OUTPUT) .isEnabled(LoggingPropertyMappers::isConsoleEnabled, CONSOLE_ENABLED_MSG) @@ -78,6 +85,14 @@ public final class LoggingPropertyMappers implements PropertyMapperGrouping { .to("quarkus.log.console.json.log-format") .paramLabel("format") .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_NAME) + .isEnabled(LoggingPropertyMappers::isConsoleJsonEnabled, "%s and output is set to 'json'".formatted(CONSOLE_ENABLED_MSG)) + .to("quarkus.log.console.json.additional-field.\"service.name\".value") + .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_ENVIRONMENT) + .isEnabled(LoggingPropertyMappers::isConsoleJsonEnabled, "%s and output is set to 'json'".formatted(CONSOLE_ENABLED_MSG)) + .to("quarkus.log.console.json.additional-field.\"service.environment\".value") + .build(), fromOption(LoggingOptions.LOG_CONSOLE_INCLUDE_TRACE) .isEnabled(() -> LoggingPropertyMappers.isConsoleEnabled() && TracingPropertyMappers.isTracingEnabled(), "Console log handler and Tracing is activated") @@ -134,6 +149,14 @@ public final class LoggingPropertyMappers implements PropertyMapperGrouping { .to("quarkus.log.file.json.log-format") .paramLabel("format") .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_NAME) + .isEnabled(LoggingPropertyMappers::isFileJsonEnabled, FILE_ENABLED_MSG + " and output is set to 'json'") + .to("quarkus.log.file.json.additional-field.\"service.name\".value") + .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_ENVIRONMENT) + .isEnabled(LoggingPropertyMappers::isFileJsonEnabled, FILE_ENABLED_MSG + " and output is set to 'json'") + .to("quarkus.log.file.json.additional-field.\"service.environment\".value") + .build(), fromOption(LoggingOptions.LOG_FILE_INCLUDE_TRACE) .isEnabled(() -> LoggingPropertyMappers.isFileEnabled() && TracingPropertyMappers.isTracingEnabled(), "File log handler and Tracing is activated") @@ -246,6 +269,14 @@ public final class LoggingPropertyMappers implements PropertyMapperGrouping { .to("quarkus.log.syslog.json.log-format") .paramLabel("format") .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_NAME) + .isEnabled(LoggingPropertyMappers::isSyslogJsonEnabled, SYSLOG_ENABLED_MSG + " and output is set to 'json'") + .to("quarkus.log.syslog.json.additional-field.\"service.name\".value") + .build(), + fromParentOption(LoggingOptions.LOG_SERVICE_ENVIRONMENT) + .isEnabled(LoggingPropertyMappers::isSyslogJsonEnabled, SYSLOG_ENABLED_MSG + " and output is set to 'json'") + .to("quarkus.log.syslog.json.additional-field.\"service.environment\".value") + .build(), fromOption(LoggingOptions.LOG_SYSLOG_INCLUDE_TRACE) .isEnabled(() -> LoggingPropertyMappers.isSyslogEnabled() && TracingPropertyMappers.isTracingEnabled(), "Syslog handler and Tracing is activated") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java index 380f8c6342e..8525a50a094 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java @@ -36,6 +36,7 @@ import org.keycloak.config.Option; import org.keycloak.config.OptionBuilder; import org.keycloak.config.OptionCategory; import org.keycloak.config.WildcardOptionsUtil; +import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.quarkus.runtime.cli.PropertyException; import org.keycloak.quarkus.runtime.cli.ShortErrorMessageHandler; import org.keycloak.quarkus.runtime.cli.command.AbstractCommand; @@ -573,6 +574,18 @@ public class PropertyMapper { return new PropertyMapper.Builder<>(opt); } + /** + * Create a property mapper that get value from the parent option + */ + public static PropertyMapper.Builder fromParentOption(Option parentOption) { + final var option = new OptionBuilder<>(parentOption.getKey() + KeycloakModelUtils.generateId(), parentOption.getType()) + .buildTime(parentOption.isBuildTime()) + .hidden() + .build(); + return new Builder<>(option) + .mapFrom(parentOption); + } + /** * Create a property mapper from a feature. * The mapper maps to external properties the state of the feature. diff --git a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/LoggingConfigurationTest.java b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/LoggingConfigurationTest.java index 776b75c6c04..0e7b3441e97 100644 --- a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/LoggingConfigurationTest.java +++ b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/LoggingConfigurationTest.java @@ -305,6 +305,34 @@ public class LoggingConfigurationTest extends AbstractConfigurationTest { )); } + @Test + public void jsonServiceFields() { + putEnvVars(Map.of( + "KC_LOG", "console,file,syslog", + "KC_LOG_CONSOLE_OUTPUT", "json", + "KC_LOG_FILE_OUTPUT", "json", + "KC_LOG_SYSLOG_OUTPUT", "json", + "KC_LOG_SERVICE_NAME", "my-service", + "KC_LOG_SERVICE_ENVIRONMENT", "production" + )); + + initConfig(); + + assertConfig(Map.of( + "log-service-name", "my-service", + "log-service-environment", "production" + )); + + assertExternalConfig(Map.of( + "quarkus.log.console.json.additional-field.\"service.name\".value", "my-service", + "quarkus.log.console.json.additional-field.\"service.environment\".value", "production", + "quarkus.log.file.json.additional-field.\"service.name\".value", "my-service", + "quarkus.log.file.json.additional-field.\"service.environment\".value", "production", + "quarkus.log.syslog.json.additional-field.\"service.name\".value", "my-service", + "quarkus.log.syslog.json.additional-field.\"service.environment\".value", "production" + )); + } + @Test public void testWildcardCliOptionCanBeMappedToQuarkusOption() { ConfigArgsConfigSource.setCliArgs("--log-level-org.keycloak=trace"); diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/LoggingDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/LoggingDistTest.java index ebee717dd24..80e24140b89 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/LoggingDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/LoggingDistTest.java @@ -274,6 +274,19 @@ public class LoggingDistTest { assertThat(data, containsString("@timestamp")); } + @Test + @Launch({"start-dev", "--log=console,file", "--log-console-output=json", "--log-console-json-format=ecs", "--log-file-output=json", "--log-file-json-format=ecs", "--log-service-name=my-custom-service", "--log-service-environment=my-custom-env"}) + void ecsFormatServiceFields(CLIResult cliResult, RawDistRootPath path) { + var output = cliResult.getOutput(); + + assertThat(output, containsString("\"service.name\":\"my-custom-service\"")); + assertThat(output, containsString("\"service.environment\":\"my-custom-env\"")); + + String data = readDefaultFileLog(path); + assertThat(data, containsString("\"service.name\":\"my-custom-service\"")); + assertThat(data, containsString("\"service.environment\":\"my-custom-env\"")); + } + @Test @Launch({"start-dev", "--log-async=true"}) void asyncLogging(CLIResult cliResult) { diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/OptionsDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/OptionsDistTest.java index 7540b7381b0..ecb4c280859 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/OptionsDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/OptionsDistTest.java @@ -60,7 +60,7 @@ public class OptionsDistTest { @Launch({"start", "--db=dev-file", "--log=console", "--log-file-output=json", "--http-enabled=true", "--hostname-strict=false"}) public void testServerDoesNotStartIfDisabledFileLogOption(CLIResult result) { result.assertError("Disabled option: '--log-file-output'. Available only when File log handler is activated"); - result.assertError("--log, --log-async, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-console-async, --log-level, --log-level-"); + result.assertError("--log, --log-async, --log-service-name, --log-service-environment, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-console-async, --log-level, --log-level-"); } @DryRun @@ -114,7 +114,7 @@ public class OptionsDistTest { @Launch({"start-dev", "--log=console", "--log-file-output=json"}) public void testServerDoesNotStartDevIfDisabledFileLogOption(CLIResult result) { result.assertError("Disabled option: '--log-file-output'. Available only when File log handler is activated"); - result.assertError("Possible solutions: --log, --log-async, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-console-async, --log-level, --log-level-"); + result.assertError("Possible solutions: --log, --log-async, --log-service-name, --log-service-environment, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-console-async, --log-level, --log-level-"); } @DryRun @@ -124,7 +124,7 @@ public class OptionsDistTest { public void testServerStartDevIfEnabledFileLogOption(CLIResult result) { result.assertNoError("Disabled option: '--log-file-output'. Available only when File log handler is activated"); result.assertError("Disabled option: '--log-console-color'. Available only when Console log handler is activated"); - result.assertError("Possible solutions: --log, --log-async, --log-file, --log-file-level, --log-file-format, --log-file-json-format, --log-file-output, --log-file-async, --log-file-rotation-enabled, --log-file-rotation-max-file-size, --log-file-rotation-max-backup-index, --log-file-rotation-file-suffix, --log-file-rotation-rotate-on-boot, --log-level, --log-level-, --log-mdc-enabled"); + result.assertError("Possible solutions: --log, --log-async, --log-service-name, --log-service-environment, --log-file, --log-file-level, --log-file-format, --log-file-json-format, --log-file-output, --log-file-async, --log-file-rotation-enabled, --log-file-rotation-max-file-size, --log-file-rotation-max-backup-index, --log-file-rotation-file-suffix, --log-file-rotation-rotate-on-boot, --log-level, --log-level-, --log-mdc-enabled"); } @DryRun diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminService.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminService.approved.txt index aba37d873fb..0a495dc7e64 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminService.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminService.approved.txt @@ -238,6 +238,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminUser.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminUser.approved.txt index 8e4d9b3bfcc..576c52c2a8d 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminUser.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminUser.approved.txt @@ -240,6 +240,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt index fb01d161947..cedb24630ec 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt @@ -233,6 +233,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt index ea06ffef6e4..cd16bd1b743 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt @@ -312,6 +312,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt index 8bba85a8370..5529e9b8ca9 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt @@ -233,6 +233,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt index 76168116a63..608779164a0 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt @@ -312,6 +312,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt index 547fae83c12..912be1dd4bb 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt @@ -478,6 +478,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt index e1e5416f538..401adcbe941 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt @@ -677,6 +677,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt index 797daed39b7..f6505764bbc 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt @@ -526,6 +526,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt index e92f5ee9dcf..3e47e38d7e1 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt @@ -678,6 +678,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt index d93b25bc0c5..7d31d2d9625 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt @@ -459,6 +459,12 @@ Logging: The log level of a category. Takes precedence over the 'log-level' option. Possible values are (case insensitive): off, fatal, error, warn, info, debug, trace, all. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Truststore: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt index ecc9a039550..0e141a9826e 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt @@ -607,6 +607,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelp.approved.txt index 2be2c6fb7e0..4f612edd8d7 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelp.approved.txt @@ -525,6 +525,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelpAll.approved.txt index b79f84a3dcc..cca7a84bdb9 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityCheckHelpAll.approved.txt @@ -677,6 +677,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelp.approved.txt index 5b7425dc3e6..2f2b417610e 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelp.approved.txt @@ -523,6 +523,12 @@ Logging: Indicates whether to add information about the realm and other information to the mapped diagnostic context. All elements will be prefixed with 'kc.' Default: false. Available only when log-mdc preview feature is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. Tracing: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelpAll.approved.txt index ca9092a0606..26eb2fd6862 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testUpdateCompatibilityMetadataHelpAll.approved.txt @@ -675,6 +675,12 @@ Logging: ipAddress, org, sessionId, authenticationSessionId, authenticationTabId. Default: realmName,clientId,org,sessionId,authenticationSessionId, authenticationTabId. Available only when MDC logging is enabled. +--log-service-environment + Set the 'service.environment' field in JSON log entries for all log handlers. + In ECS format, defaults to the Quarkus profile if not set. +--log-service-name + Set the 'service.name' field in JSON log entries for all log handlers. + Default: keycloak. --log-syslog-app-name Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated.