diff --git a/docs/documentation/release_notes/topics/26_0_0.adoc b/docs/documentation/release_notes/topics/26_0_0.adoc index aff118a83e..03d181961a 100644 --- a/docs/documentation/release_notes/topics/26_0_0.adoc +++ b/docs/documentation/release_notes/topics/26_0_0.adoc @@ -158,6 +158,13 @@ GELF support has been deprecated for a while now, and with this release it has b Other log handlers are available and fully supported to be used as a replacement of GELF, for example Syslog. For details see the https://www.keycloak.org/server/logging[Logging guide]. += Specify different log levels for log handlers + +It is possible to specify log levels for all available log handlers, such as `console`, `file`, or `syslog`. +The more fine-grained approach provides the ability to control logging over the whole application and be tailored to your needs. + +For more information, see the https://www.keycloak.org/server/logging[Logging guide]. + = All user sessions are persisted by default {project_name} 25 introduced the feature `persistent-user-sessions`. With this feature enabled all user sessions are persisted in the database as opposed to the previous behavior where only offline sessions were persisted. diff --git a/docs/guides/server/logging.adoc b/docs/guides/server/logging.adoc index 8baacd9a34..e714059155 100644 --- a/docs/guides/server/logging.adoc +++ b/docs/guides/server/logging.adoc @@ -9,15 +9,18 @@ title="Configuring logging" summary="Learn how to configure Logging" includedOptions="log log-*"> -{project_name} uses the JBoss Logging framework. The following is a high-level overview for the available log handlers: +{project_name} uses the JBoss Logging framework. +The following is a high-level overview for the available log handlers with the common parent log handler `root`: -* root -** console (_default_) -** file -** Syslog +<@opts.expectedValues option="log"/> == Logging configuration -Logging is done on a per-category basis in {project_name}. You can configure logging for the root log level or for more specific categories such as `org.hibernate` or `org.keycloak`. This {section} describes how to configure logging. + +Logging is done on a per-category basis in {project_name}. +You can configure logging for the root log level or for more specific categories such as `org.hibernate` or `org.keycloak`. +It is also possible to tailor log levels for each particular log handler. + +This {section} describes how to configure logging. === Log levels @@ -71,15 +74,59 @@ To enable log handlers, enter the following command: <@kc.start parameters="--log=\",\""/> -The available handlers are -<@profile.ifCommunity> -`console`, `file`, `syslog`. - -<@profile.ifProduct> -`console`, `file` and `syslog`. - +The available handlers are: + +<@opts.expectedValues option="log"/> + The more specific handler configuration mentioned below will only take effect when the handler is added to this comma-separated list. +== Specify log level for each handler + +The `log-level` property specifies the global root log level and levels for selected categories. +However, a more fine-grained approach for log levels is necessary to comply with the modern application requirements. + +To set log levels for particular handlers, properties in format `log--level` (where `` is available log handler) were introduced. + +It means properties for log level settings look like this: + +* `log-console-level` - Console log handler +* `log-file-level` - File log handler +* `log-syslog-level` - Syslog log handler + +NOTE: The `log--level` properties are available only when the particular log handlers are enabled. +More information in log handlers settings below. + +Only log levels specified in <> section are accepted, and *must be in lowercase*. +There is no support for specifying particular categories for log handlers yet. + +=== General principle + +It is necessary to understand that setting the log levels for each particular handler *does not override the root level* specified in the `log-level` property. +Log handlers respect the root log level, which represents the maximal verbosity for the whole logging system. +It means individual log handlers can be configured to be less verbose than the root logger, but not more. + +Specifically, when an arbitrary log level is defined for the handler, it does not mean the log records with the log level will be present in the output. +In that case, the root `log-level` must also be assessed. +Log handler levels provide the *restriction for the root log level*, and the default log level for log handlers is `all` - without any restriction. + +=== Examples + +.Example: `debug` for file handler, but `info` for console handler: +<@kc.start parameters="--log=console,file --log-level=debug --log-console-level=info"/> + +The root log level is set to `debug`, so every log handler inherits the value - so does the file log handler. +To hide `debug` records in the console, we need to set the minimal (least severe) level to `info` for the console handler. + +.Example: `warn` for all handlers, but `debug` for file handler: +<@kc.start parameters="--log=console,file,syslog --log-level=debug --log-console-level=warn --log-syslog-level=warn"/> + +The root level must be set to the most verbose required level (`debug` in this case), and other log handlers must be amended accordingly. + +.Example: `info` for all handlers, but `debug`+`org.keycloak.events:trace` for Syslog handler: +<@kc.start parameters="--log=console,file,syslog --log-level=debug,org.keycloak.events:trace, --log-syslog-level=trace --log-console-level=info --log-file-level=info"/> + +In order to see the `org.keycloak.events:trace`, the `trace` level must be set for the Syslog handler. + == Console log handler The console log handler is enabled by default, providing unstructured log messages for the console. @@ -158,6 +205,13 @@ Colored console log output for unstructured logs is disabled by default. Colors <@kc.start parameters="--log-console-color="/> +=== Configuring the console log level +Log level for console log handler can be specified by `--log-console-level` property as follows: + +<@kc.start parameters="--log-console-level=warn"/> + +For more information, see the section <> above. + == File logging As an alternative to logging to the console, you can use unstructured logging to a file. @@ -187,6 +241,13 @@ To configure a different logging format for the file log handler, enter the foll See <> for more information and a table of the available pattern configuration. +=== Configuring the file log level +Log level for file log handler can be specified by `--log-file-level` property as follows: + +<@kc.start parameters="--log-file-level=warn"/> + +For more information, see the section <> above. + == Centralized logging using Syslog {project_name} provides the ability to send logs to a remote Syslog server. @@ -213,6 +274,13 @@ To configure the endpoint(_host:port_) of your centralized logging system, enter When the Syslog handler is enabled, the host is using `localhost` as host value. The Default port is `514`. +=== Configuring the Syslog log level +Log level for Syslog log handler can be specified by `--log-syslog-level` property as follows: + +<@kc.start parameters="--log-syslog-level=warn"/> + +For more information, see the section <> above. + === Configuring the Syslog protocol Syslog uses TCP as the default protocol for communication. To use UDP instead of TCP, add the `--log-syslog-protocol` option as follows: 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 c775f930e7..3aee1d0bbc 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 @@ -77,6 +77,14 @@ public class LoggingOptions { .description("Set the log output to JSON or default (plain) unstructured logging.") .build(); + public static final Option LOG_CONSOLE_LEVEL = new OptionBuilder<>("log-console-level", Level.class) + .category(OptionCategory.LOGGING) + .defaultValue(Level.ALL) + .description("Set the log level for the console handler. It specifies the most verbose log level for logs shown in the output. " + + "It respects levels specified in the 'log-level' option, which represents the maximal verbosity for the whole logging system. " + + "For more information, check the Logging guide.") + .build(); + public static final Option LOG_CONSOLE_FORMAT = new OptionBuilder<>("log-console-format", String.class) .category(OptionCategory.LOGGING) .description("The format of unstructured console log entries. If the format has spaces in it, escape the value using \"\".") @@ -112,6 +120,14 @@ public class LoggingOptions { .defaultValue(new File(DEFAULT_LOG_PATH)) .build(); + public static final Option LOG_FILE_LEVEL = new OptionBuilder<>("log-file-level", Level.class) + .category(OptionCategory.LOGGING) + .defaultValue(Level.ALL) + .description("Set the log level for the file handler. It specifies the most verbose log level for logs shown in the output. " + + "It respects levels specified in the 'log-level' option, which represents the maximal verbosity for the whole logging system. " + + "For more information, check the Logging guide.") + .build(); + public static final Option LOG_FILE_FORMAT = new OptionBuilder<>("log-file-format", String.class) .category(OptionCategory.LOGGING) .description("Set a format specific to file log entries.") @@ -142,6 +158,14 @@ public class LoggingOptions { .defaultValue("localhost:514") .build(); + public static final Option LOG_SYSLOG_LEVEL = new OptionBuilder<>("log-syslog-level", Level.class) + .category(OptionCategory.LOGGING) + .defaultValue(Level.ALL) + .description("Set the log level for the Syslog handler. It specifies the most verbose log level for logs shown in the output. " + + "It respects levels specified in the 'log-level' option, which represents the maximal verbosity for the whole logging system. " + + "For more information, check the Logging guide.") + .build(); + public static final Option LOG_SYSLOG_TYPE = new OptionBuilder<>("log-syslog-type", String.class) .category(OptionCategory.LOGGING) .expectedValues(Arrays.stream(SyslogHandler.SyslogType.values()).map(f -> f.toString().toLowerCase()).toList()) 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 4307e6cc3a..224c66bc92 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 @@ -42,6 +42,11 @@ public final class LoggingPropertyMappers { .paramLabel("output") .transformer(LoggingPropertyMappers::resolveLogOutput) .build(), + fromOption(LoggingOptions.LOG_CONSOLE_LEVEL) + .isEnabled(LoggingPropertyMappers::isConsoleEnabled, CONSOLE_ENABLED_MSG) + .to("quarkus.log.console.level") + .paramLabel("level") + .build(), fromOption(LoggingOptions.LOG_CONSOLE_FORMAT) .isEnabled(LoggingPropertyMappers::isConsoleEnabled, CONSOLE_ENABLED_MSG) .to("quarkus.log.console.format") @@ -73,6 +78,11 @@ public final class LoggingPropertyMappers { .paramLabel("file") .transformer(LoggingPropertyMappers::resolveFileLogLocation) .build(), + fromOption(LoggingOptions.LOG_FILE_LEVEL) + .isEnabled(LoggingPropertyMappers::isFileEnabled, FILE_ENABLED_MSG) + .to("quarkus.log.file.level") + .paramLabel("level") + .build(), fromOption(LoggingOptions.LOG_FILE_FORMAT) .isEnabled(LoggingPropertyMappers::isFileEnabled, FILE_ENABLED_MSG) .to("quarkus.log.file.format") @@ -107,6 +117,11 @@ public final class LoggingPropertyMappers { .to("quarkus.log.syslog.endpoint") .paramLabel("host:port") .build(), + fromOption(LoggingOptions.LOG_SYSLOG_LEVEL) + .isEnabled(LoggingPropertyMappers::isSyslogEnabled, SYSLOG_ENABLED_MSG) + .to("quarkus.log.syslog.level") + .paramLabel("level") + .build(), fromOption(LoggingOptions.LOG_SYSLOG_APP_NAME) .isEnabled(LoggingPropertyMappers::isSyslogEnabled, SYSLOG_ENABLED_MSG) .to("quarkus.log.syslog.app-name") diff --git a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java index 230e951fd2..dd5f057e40 100644 --- a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java +++ b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java @@ -64,7 +64,7 @@ public class ConfigurationTest extends AbstractConfigurationTest { @Test public void testKeycloakConfPlaceholder() { - assertEquals("warn", createConfig().getRawValue("kc.log-level")); + assertEquals("info", createConfig().getRawValue("kc.log-level")); putEnvVar("SOME_LOG_LEVEL", "debug"); assertEquals("debug", createConfig().getRawValue("kc.log-level")); } @@ -476,7 +476,7 @@ public class ConfigurationTest extends AbstractConfigurationTest { ConfigValue secret = config.getConfigValue("my.secret"); assertEquals("secret", secret.getValue()); } - + @Test public void testReloadPeriod() { ConfigArgsConfigSource.setCliArgs(""); diff --git a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/LoggingConfigurationTest.java b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/LoggingConfigurationTest.java index d79ba8b286..19f4e02d9c 100644 --- a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/LoggingConfigurationTest.java +++ b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/LoggingConfigurationTest.java @@ -158,4 +158,30 @@ public class LoggingConfigurationTest extends AbstractConfigurationTest { assertConfig("log-syslog-max-length", "512"); assertExternalConfig("quarkus.log.syslog.max-length", "512"); } + + @Test + public void logLevelsHandlers() { + putEnvVars(Map.of( + "KC_LOG_LEVEL", "debug", + "KC_LOG_CONSOLE_LEVEL", "info", + "KC_LOG_SYSLOG_LEVEL", "trace", + "KC_LOG_FILE_LEVEL", "debug" + )); + + initConfig(); + + assertConfig(Map.of( + "log-level", "debug", + "log-console-level", "info", + "log-syslog-level", "trace", + "log-file-level", "debug" + )); + + assertExternalConfig(Map.of( + "quarkus.log.level", "DEBUG", + "quarkus.log.console.level", "info", + "quarkus.log.syslog.level", "trace", + "quarkus.log.file.level", "debug" + )); + } } diff --git a/quarkus/runtime/src/test/resources/META-INF/keycloak.conf b/quarkus/runtime/src/test/resources/META-INF/keycloak.conf index 2ffe93db01..2147f55822 100644 --- a/quarkus/runtime/src/test/resources/META-INF/keycloak.conf +++ b/quarkus/runtime/src/test/resources/META-INF/keycloak.conf @@ -1,6 +1,6 @@ spi-hostname-default-frontend-url = ${keycloak.frontendUrl:http://filepropdefault.unittest} %user-profile.spi-hostname-default-frontend-url = http://filepropprofile.unittest -log-level=${SOME_LOG_LEVEL:warn} +log-level=${SOME_LOG_LEVEL:info} config-keystore=src/test/resources/keystore config-keystore-password=secret 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 3fd3caf6fe..c12e10bfbd 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 @@ -17,6 +17,10 @@ package org.keycloak.it.cli.dist; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.keycloak.quarkus.runtime.cli.command.Main.CONFIG_FILE_LONG_NAME; @@ -118,11 +122,8 @@ public class LoggingDistTest { @Test @Launch({ "start-dev", "--log=console,file", "--log-file-format=\"%d{HH:mm:ss} %-5p [%c{1.}] (%t) %s%e%n\""}) - void testFileLoggingHasDifferentFormat(RawDistRootPath path) throws IOException { - Path logFilePath = Paths.get(path.getDistRootPath() + File.separator + LoggingOptions.DEFAULT_LOG_PATH); - File logFile = new File(logFilePath.toString()); - - String data = FileUtils.readFileToString(logFile, Charset.defaultCharset()); + void testFileLoggingHasDifferentFormat(RawDistRootPath path) { + String data = readDefaultFileLog(path); assertTrue(data.contains("INFO [i.quarkus] (main)"), "Format not applied"); } @@ -169,4 +170,79 @@ public class LoggingDistTest { cliResult.assertNoMessage("Listening on:"); cliResult.assertError("Error writing to TCP stream"); } + + @Test + @Launch({"start-dev", "--log-console-level=wrong"}) + void wrongLevelForHandlers(LaunchResult result) { + CLIResult cliResult = (CLIResult) result; + cliResult.assertError("Invalid value for option '--log-console-level': wrong. Expected values are: off, fatal, error, warn, info, debug, trace, all"); + } + + @Test + @Launch({"start-dev", "--log=console,file", "--log-console-level=debug", "--log-file-level=debug"}) + void levelRootDefault(LaunchResult result, RawDistRootPath path) { + CLIResult cliResult = (CLIResult) result; + var output = cliResult.getOutput(); + + assertThat(output, not(containsString("DEBUG [org.hibernate"))); + assertThat(output, not(containsString("DEBUG [org.keycloak"))); + + var fileLog = readDefaultFileLog(path); + assertThat(fileLog, notNullValue()); + assertFalse(fileLog.isBlank()); + + assertThat(fileLog, not(containsString("DEBUG [org.hibernate"))); + assertThat(fileLog, not(containsString("DEBUG [org.keycloak"))); + + assertThat(fileLog, containsString("INFO [io.quarkus]")); + assertThat(fileLog, containsString("INFO [org.keycloak")); + } + + @Test + @Launch({"start-dev", "--log=console,file", "--log-level=org.keycloak:debug", "--log-console-level=debug", "--log-file-level=debug"}) + void levelRootCategoryDebug(LaunchResult result, RawDistRootPath path) { + CLIResult cliResult = (CLIResult) result; + var output = cliResult.getOutput(); + + assertThat(output, not(containsString("DEBUG [org.hibernate"))); + assertThat(output, containsString("DEBUG [org.keycloak")); + + var fileLog = readDefaultFileLog(path); + assertThat(fileLog, notNullValue()); + assertFalse(fileLog.isBlank()); + + assertThat(fileLog, not(containsString("DEBUG [org.hibernate"))); + assertThat(fileLog, containsString("DEBUG [org.keycloak")); + + assertThat(fileLog, containsString("INFO [io.quarkus]")); + assertThat(fileLog, containsString("INFO [org.keycloak")); + } + + @Test + @Launch({"start-dev", "--log=console,file", "--log-level=info,org.keycloak:warn", "--log-console-level=off", "--log-file-level=off"}) + void levelOffHandlers(LaunchResult result, RawDistRootPath path) { + CLIResult cliResult = (CLIResult) result; + var output = cliResult.getOutput(); + + // log contains DB migration status + build time logs + assertThat(output, not(containsString("DEBUG [org.hibernate"))); + assertThat(output, not(containsString("INFO [org.keycloak"))); + assertThat(output, not(containsString("INFO [io.quarkus"))); + + var fileLog = readDefaultFileLog(path); + assertThat(fileLog, notNullValue()); + assertTrue(fileLog.isBlank()); + } + + protected static String readDefaultFileLog(RawDistRootPath path) { + Path logFilePath = Paths.get(path.getDistRootPath() + File.separator + LoggingOptions.DEFAULT_LOG_PATH); + File logFile = new File(logFilePath.toString()); + assertTrue(logFile.isFile(), "Log file does not exist!"); + + try { + return FileUtils.readFileToString(logFile, Charset.defaultCharset()); + } catch (IOException e) { + throw new AssertionError("Cannot read default file log", e); + } + } } 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 683ef48a1c..e29efe6079 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 @@ -58,7 +58,7 @@ public class OptionsDistTest { @Launch({"start", "--log=console", "--log-file-output=json", "--http-enabled=true", "--hostname-strict=false"}) public void testServerDoesNotStartIfDisabledFileLogOption(LaunchResult result) { assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Disabled option: '--log-file-output'. Available only when File log handler is activated")).count()); - assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-console-output, --log-console-format, --log-console-color")).count()); + assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-level")).count()); } @Test @@ -110,7 +110,7 @@ public class OptionsDistTest { @Launch({"start-dev", "--log=console", "--log-file-output=json"}) public void testServerDoesNotStartDevIfDisabledFileLogOption(LaunchResult result) { assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Disabled option: '--log-file-output'. Available only when File log handler is activated")).count()); - assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-console-output, --log-console-format, --log-console-color")).count()); + assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-console-output, --log-console-level, --log-console-format, --log-console-color, --log-level")).count()); } @Test @@ -119,6 +119,6 @@ public class OptionsDistTest { public void testServerStartDevIfEnabledFileLogOption(LaunchResult result) { assertEquals(0, result.getErrorStream().stream().filter(s -> s.contains("Disabled option: '--log-file-output'. Available only when File log handler is activated")).count()); assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Disabled option: '--log-console-color'. Available only when Console log handler is activated")).count()); - assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-file, --log-file-format, --log-file-output, --log-level")).count()); + assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Possible solutions: --log, --log-file, --log-file-level, --log-file-format, --log-file-output, --log-level")).count()); } } diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesAutoBuildDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesAutoBuildDistTest.java index e737498955..3e5144cbf5 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesAutoBuildDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesAutoBuildDistTest.java @@ -17,8 +17,9 @@ package org.keycloak.it.cli.dist; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.function.Consumer; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; @@ -48,23 +49,24 @@ public class QuarkusPropertiesAutoBuildDistTest { } @Test - @BeforeStartDistribution(QuarkusPropertiesAutoBuildDistTest.UpdateConsoleLogLevelToWarn.class) + @BeforeStartDistribution(EnableAdditionalConsoleHandler.class) @Launch({ "start" }) @Order(2) void testQuarkusRuntimePropDoesNotTriggerReAug(LaunchResult result) { CLIResult cliResult = (CLIResult) result; cliResult.assertNoBuild(); - assertFalse(cliResult.getOutput().contains("INFO [io.quarkus]")); + + assertThat(cliResult.getOutput(), containsString("Keycloak is the best")); } @Test - @BeforeStartDistribution(UpdateConsoleLogLevelToInfo.class) + @BeforeStartDistribution(DisableAdditionalConsoleHandler.class) @Launch({ "start" }) @Order(3) void testNoReAugAfterChangingRuntimeProperty(LaunchResult result) { CLIResult cliResult = (CLIResult) result; cliResult.assertNoBuild(); - assertTrue(cliResult.getOutput().contains("INFO [io.quarkus]")); + assertThat(cliResult.getOutput(), not(containsString("Keycloak is the best"))); } @Test @@ -122,18 +124,20 @@ public class QuarkusPropertiesAutoBuildDistTest { cliResult.assertError("Multiple datasources are configured but more than 1 is using non-XA transactions."); } - public static class UpdateConsoleLogLevelToWarn implements Consumer { + public static class EnableAdditionalConsoleHandler implements Consumer { @Override public void accept(KeycloakDistribution distribution) { - distribution.setQuarkusProperty("quarkus.log.console.level", "WARN"); + distribution.setQuarkusProperty("quarkus.log.handler.console.\"console-2\".enable", "true"); + distribution.setQuarkusProperty("quarkus.log.handler.console.\"console-2\".format", "Keycloak is the best"); + distribution.setQuarkusProperty("quarkus.log.handlers", "console-2"); } } - public static class UpdateConsoleLogLevelToInfo implements Consumer { + public static class DisableAdditionalConsoleHandler implements Consumer { @Override public void accept(KeycloakDistribution distribution) { - distribution.setQuarkusProperty("quarkus.log.console.level", "INFO"); + distribution.setQuarkusProperty("quarkus.log.handler.console.\"console-2\".enable", "false"); } } diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java index 9a19f4ddaa..34ef5f12d3 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java @@ -17,15 +17,8 @@ package org.keycloak.it.cli.dist; -import static io.restassured.RestAssured.when; -import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.OPTIMIZED_BUILD_OPTION_LONG; - -import java.util.Optional; -import java.util.function.Consumer; - +import io.quarkus.test.junit.main.Launch; +import io.quarkus.test.junit.main.LaunchResult; import io.restassured.RestAssured; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; @@ -41,8 +34,15 @@ import org.keycloak.it.junit5.extension.KeepServerAlive; import org.keycloak.it.junit5.extension.RawDistOnly; import org.keycloak.it.utils.KeycloakDistribution; -import io.quarkus.test.junit.main.Launch; -import io.quarkus.test.junit.main.LaunchResult; +import java.util.Optional; +import java.util.function.Consumer; + +import static io.restassured.RestAssured.when; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.OPTIMIZED_BUILD_OPTION_LONG; @DistributionTest(reInstall = DistributionTest.ReInstall.NEVER) @RawDistOnly(reason = "Containers are immutable") @@ -50,10 +50,10 @@ import io.quarkus.test.junit.main.LaunchResult; public class QuarkusPropertiesDistTest { private static final String QUARKUS_BUILDTIME_HIBERNATE_METRICS_KEY = "quarkus.datasource.metrics.enabled"; - private static final String QUARKUS_RUNTIME_CONSOLE_LOGLVL_KEY = "quarkus.log.console.level"; + private static final String QUARKUS_RUNTIME_CONSOLE_HANDLER_ENABLED_KEY = "quarkus.log.handler.console.\"console-2\".enable"; @Test - @Launch({ "build" }) + @Launch({"build"}) @Order(1) void testBuildWithPropertyFromQuarkusProperties(LaunchResult result) { CLIResult cliResult = (CLIResult) result; @@ -61,48 +61,48 @@ public class QuarkusPropertiesDistTest { } @Test - @BeforeStartDistribution(QuarkusPropertiesDistTest.UpdateConsoleLogLevelToWarnFromQuarkusProps.class) - @Launch({ "start", "--http-enabled=true", "--hostname-strict=false" }) + @BeforeStartDistribution(QuarkusPropertiesDistTest.AddConsoleHandlerFromQuarkusProps.class) + @Launch({"start", "--http-enabled=true", "--hostname-strict=false"}) @Order(2) void testPropertyEnabledAtRuntime(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertFalse(cliResult.getOutput().contains("INFO")); + assertThat(cliResult.getOutput(), containsString("Keycloak is the best")); } @Test - @Launch({ "-Dquarkus.log.console.level=info", "start", "--http-enabled=true", "--hostname-strict=false" }) + @Launch({"-Dquarkus.log.handler.console.\"console-2\".enable=false", "start", "--http-enabled=true", "--hostname-strict=false"}) @Order(3) void testIgnoreQuarkusSystemPropertiesAtStart(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertFalse(cliResult.getOutput().contains("INFO")); + assertThat(cliResult.getOutput(), containsString("Keycloak is the best")); } @Test - @Launch({ "-Dquarkus.log.console.level=info", "build" }) + @Launch({"-Dquarkus.log.handler.console.\"console-2\".enable=false", "build"}) @Order(4) void testIgnoreQuarkusSystemPropertyAtBuild(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertFalse(cliResult.getOutput().contains("INFO")); + assertThat(cliResult.getOutput(), containsString("Keycloak is the best")); cliResult.assertBuild(); } @Test - @BeforeStartDistribution(UpdateConsoleLogLevelToInfoFromKeycloakConf.class) - @Launch({ "build" }) + @BeforeStartDistribution(UpdateConsoleHandlerFromKeycloakConf.class) + @Launch({"build"}) @Order(5) void testIgnoreQuarkusPropertyFromKeycloakConf(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertTrue(cliResult.getOutput().contains("INFO")); + assertThat(cliResult.getOutput(), not(containsString("Keycloak is the best"))); cliResult.assertBuild(); } @Test - @BeforeStartDistribution(UpdateConsoleLogLevelToInfoFromQuarkusProps.class) - @Launch({ "start", "--http-enabled=true", "--hostname-strict=false" }) + @BeforeStartDistribution(UpdateConsoleHandlerFromQuarkusProps.class) + @Launch({"start", "--http-enabled=true", "--hostname-strict=false"}) @Order(6) void testRuntimePropFromQuarkusPropsIsAppliedWithoutRebuild(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertTrue(cliResult.getOutput().contains("INFO")); + assertThat(cliResult.getOutput(), not(containsString("Keycloak is the best"))); cliResult.assertNoBuild(); } @@ -166,7 +166,7 @@ public class QuarkusPropertiesDistTest { void testSmallRyeKeyStoreConfigSource(LaunchResult result) { // keytool -importpass -alias kc.log-level -keystore keystore -storepass secret -storetype PKCS12 -v (with "debug" as the stored password) CLIResult cliResult = (CLIResult) result; - assertTrue(cliResult.getOutput().contains("DEBUG")); + assertThat(cliResult.getOutput(),containsString("DEBUG")); cliResult.assertStarted(); } @@ -179,7 +179,7 @@ public class QuarkusPropertiesDistTest { @Order(13) void testHttpCertsPathTransformer(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertTrue(cliResult.getOutput().contains("ERROR: /tmp/kc/bin/../conf/server.crt.pem")); + assertThat(cliResult.getOutput(),containsString("ERROR: /tmp/kc/bin/../conf/server.crt.pem")); } @Test @@ -191,31 +191,33 @@ public class QuarkusPropertiesDistTest { @Order(14) void testHttpCertsPathTransformerOnWindows(LaunchResult result) { CLIResult cliResult = (CLIResult) result; - assertTrue(cliResult.getOutput().contains("ERROR: C:/tmp/kc/bin/../conf/server.crt.pem")); + assertThat(cliResult.getOutput(),containsString("ERROR: C:/tmp/kc/bin/../conf/server.crt.pem")); } - public static class UpdateConsoleLogLevelToWarnFromQuarkusProps implements Consumer { + public static class AddConsoleHandlerFromQuarkusProps implements Consumer { @Override public void accept(KeycloakDistribution distribution) { - distribution.setQuarkusProperty(QUARKUS_RUNTIME_CONSOLE_LOGLVL_KEY, "WARN"); + distribution.setQuarkusProperty(QUARKUS_RUNTIME_CONSOLE_HANDLER_ENABLED_KEY, "true"); + distribution.setQuarkusProperty("quarkus.log.handler.console.\"console-2\".format", "Keycloak is the best"); + distribution.setQuarkusProperty("quarkus.log.handlers", "console-2"); } } - public static class UpdateConsoleLogLevelToInfoFromKeycloakConf implements Consumer { + public static class UpdateConsoleHandlerFromKeycloakConf implements Consumer { @Override public void accept(KeycloakDistribution distribution) { distribution.deleteQuarkusProperties(); - distribution.setProperty(QUARKUS_RUNTIME_CONSOLE_LOGLVL_KEY, "INFO"); + distribution.setProperty(QUARKUS_RUNTIME_CONSOLE_HANDLER_ENABLED_KEY, "false"); } } - public static class UpdateConsoleLogLevelToInfoFromQuarkusProps implements Consumer { + public static class UpdateConsoleHandlerFromQuarkusProps implements Consumer { @Override public void accept(KeycloakDistribution distribution) { distribution.deleteQuarkusProperties(); - distribution.setQuarkusProperty(QUARKUS_RUNTIME_CONSOLE_LOGLVL_KEY, "INFO"); + distribution.setQuarkusProperty(QUARKUS_RUNTIME_CONSOLE_HANDLER_ENABLED_KEY, "true"); } } @@ -236,4 +238,4 @@ public class QuarkusPropertiesDistTest { buildResult.assertBuild(); } } -} \ No newline at end of file +} 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 68fd75a48d..00d72240a5 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 @@ -127,6 +127,13 @@ Logging: The format of unstructured console log entries. If the format has spaces in it, escape the value using "". Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Console log handler is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log 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 63487aeed2..7294a04863 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 @@ -131,6 +131,13 @@ Logging: Include tracing information in the console log. If the 'log-console-format' option is specified, this option has no effect. Default: true. Available only when Console log handler and Tracing is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log @@ -145,6 +152,13 @@ Logging: Include tracing information in the file log. If the 'log-file-format' option is specified, this option has no effect. Default: true. Available only when File log handler and Tracing is activated. +--log-file-level + Set the log level for the file handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when File log handler is activated. --log-file-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when File log @@ -166,6 +180,13 @@ Logging: Include tracing information in the Syslog. If the 'log-syslog-format' option is specified, this option has no effect. Default: true. Available only when Syslog handler and Tracing is activated. +--log-syslog-level + Set the log level for the Syslog handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Syslog is activated. --log-syslog-max-length Set the maximum length, in bytes, of the message allowed to be sent. The length includes the header and the message. If not set, the default value is 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 96f8b8e6ff..873ab40cab 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 @@ -127,6 +127,13 @@ Logging: The format of unstructured console log entries. If the format has spaces in it, escape the value using "". Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Console log handler is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log 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 5c86e18182..a933e339b3 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 @@ -131,6 +131,13 @@ Logging: Include tracing information in the console log. If the 'log-console-format' option is specified, this option has no effect. Default: true. Available only when Console log handler and Tracing is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log @@ -145,6 +152,13 @@ Logging: Include tracing information in the file log. If the 'log-file-format' option is specified, this option has no effect. Default: true. Available only when File log handler and Tracing is activated. +--log-file-level + Set the log level for the file handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when File log handler is activated. --log-file-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when File log @@ -166,6 +180,13 @@ Logging: Include tracing information in the Syslog. If the 'log-syslog-format' option is specified, this option has no effect. Default: true. Available only when Syslog handler and Tracing is activated. +--log-syslog-level + Set the log level for the Syslog handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Syslog is activated. --log-syslog-max-length Set the maximum length, in bytes, of the message allowed to be sent. The length includes the header and the message. If not set, the default value is 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 d7fa40912c..9461fe7157 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 @@ -273,6 +273,13 @@ Logging: The format of unstructured console log entries. If the format has spaces in it, escape the value using "". Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Console log handler is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log 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 6e98a7de27..223d5f29d6 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 @@ -312,6 +312,13 @@ Logging: Include tracing information in the console log. If the 'log-console-format' option is specified, this option has no effect. Default: true. Available only when Console log handler and Tracing is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log @@ -326,6 +333,13 @@ Logging: Include tracing information in the file log. If the 'log-file-format' option is specified, this option has no effect. Default: true. Available only when File log handler and Tracing is activated. +--log-file-level + Set the log level for the file handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when File log handler is activated. --log-file-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when File log @@ -347,6 +361,13 @@ Logging: Include tracing information in the Syslog. If the 'log-syslog-format' option is specified, this option has no effect. Default: true. Available only when Syslog handler and Tracing is activated. +--log-syslog-level + Set the log level for the Syslog handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Syslog is activated. --log-syslog-max-length Set the maximum length, in bytes, of the message allowed to be sent. The length includes the header and the message. If not set, the default value is 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 954e02d214..5818ed91ec 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 @@ -274,6 +274,13 @@ Logging: The format of unstructured console log entries. If the format has spaces in it, escape the value using "". Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Console log handler is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log 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 6aa18d8d9c..e0e5dcf903 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 @@ -313,6 +313,13 @@ Logging: Include tracing information in the console log. If the 'log-console-format' option is specified, this option has no effect. Default: true. Available only when Console log handler and Tracing is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log @@ -327,6 +334,13 @@ Logging: Include tracing information in the file log. If the 'log-file-format' option is specified, this option has no effect. Default: true. Available only when File log handler and Tracing is activated. +--log-file-level + Set the log level for the file handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when File log handler is activated. --log-file-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when File log @@ -348,6 +362,13 @@ Logging: Include tracing information in the Syslog. If the 'log-syslog-format' option is specified, this option has no effect. Default: true. Available only when Syslog handler and Tracing is activated. +--log-syslog-level + Set the log level for the Syslog handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Syslog is activated. --log-syslog-max-length Set the maximum length, in bytes, of the message allowed to be sent. The length includes the header and the message. If not set, the default value is 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 37c8c0a45b..3fe1f9f2c5 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 @@ -225,6 +225,13 @@ Logging: The format of unstructured console log entries. If the format has spaces in it, escape the value using "". Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Console log handler is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log 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 ce1126134e..fe5c8c3000 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 @@ -264,6 +264,13 @@ Logging: Include tracing information in the console log. If the 'log-console-format' option is specified, this option has no effect. Default: true. Available only when Console log handler and Tracing is activated. +--log-console-level + Set the log level for the console handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Console log handler is activated. --log-console-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Console log @@ -278,6 +285,13 @@ Logging: Include tracing information in the file log. If the 'log-file-format' option is specified, this option has no effect. Default: true. Available only when File log handler and Tracing is activated. +--log-file-level + Set the log level for the file handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when File log handler is activated. --log-file-output Set the log output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when File log @@ -299,6 +313,13 @@ Logging: Include tracing information in the Syslog. If the 'log-syslog-format' option is specified, this option has no effect. Default: true. Available only when Syslog handler and Tracing is activated. +--log-syslog-level + Set the log level for the Syslog handler. It specifies the most verbose log + level for logs shown in the output. It respects levels specified in the + 'log-level' option, which represents the maximal verbosity for the whole + logging system. For more information, check the Logging guide. Possible + values are: off, fatal, error, warn, info, debug, trace, all. Default: all. + Available only when Syslog is activated. --log-syslog-max-length Set the maximum length, in bytes, of the message allowed to be sent. The length includes the header and the message. If not set, the default value is