diff --git a/docs/guides/server/logging.adoc b/docs/guides/server/logging.adoc index 29c6c82458..8baacd9a34 100644 --- a/docs/guides/server/logging.adoc +++ b/docs/guides/server/logging.adoc @@ -2,6 +2,7 @@ <#import "/templates/kc.adoc" as kc> <#import "/templates/links.adoc" as links> <#import "/templates/profile.adoc" as profile> +<#import "/templates/options.adoc" as opts> <@tmpl.guide title="Configuring logging" @@ -235,6 +236,33 @@ Note that you need to escape characters when invoking commands containing specia This example abbreviates the category name to three characters by setting `[%c{3.}]` in the template instead of the default `[%c]`. +=== Configuring the Syslog type + +Syslog uses different message formats based on particular RFC specifications. +To change the Syslog type with a different message format, use the `--log-syslog-type` option as follows: + +<@kc.start parameters="--log-syslog-type=rfc3164"/> + +Possible values for the `--log-syslog-type` option are: + +<@opts.expectedValues option="log-syslog-type"/> + +The preferred Syslog type is https://datatracker.ietf.org/doc/html/rfc5424[RFC 5424], which obsoletes https://datatracker.ietf.org/doc/html/rfc3164[RFC 3164], known as BSD Syslog protocol. + +=== Configuring the Syslog maximum message length + +To set the maximum length of the message allowed to be sent (in bytes), use the `--log-syslog-max-length` option as follows: + +<@kc.start parameters="--log-syslog-max-length=1536"/> + +The length can be specified in memory size format with the appropriate suffix, like `1k` or `1K`. +The length includes the header and the message. + +If the length is not explicitly set, the default values are set based on the `--log-syslog-type` option as follows: + +* `2048B` - for RFC 5424 +* `1024B` - for RFC 3164 + === Configuring the Syslog structured output By default, the Syslog log handler sends plain unstructured data to the Syslog server. To use structured JSON log output instead, enter the following command: 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 70acaf1108..c775f930e7 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 @@ -1,12 +1,13 @@ package org.keycloak.config; +import io.quarkus.runtime.configuration.MemorySize; +import org.jboss.logmanager.handlers.SyslogHandler; + import java.io.File; import java.util.Arrays; import java.util.List; import java.util.Locale; -import java.util.Set; import java.util.function.Function; -import java.util.function.Predicate; import static java.lang.String.format; @@ -137,39 +138,53 @@ public class LoggingOptions { public static final Option LOG_SYSLOG_ENDPOINT = new OptionBuilder<>("log-syslog-endpoint", String.class) .category(OptionCategory.LOGGING) - .description("The IP address and port of the syslog server.") + .description("Set the IP address and port of the Syslog server.") .defaultValue("localhost:514") .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()) + .description("Set the Syslog type used to format the sent message.") + .defaultValue(SyslogHandler.SyslogType.RFC5424.toString().toLowerCase()) + .build(); + + public static final Option LOG_SYSLOG_MAX_LENGTH = new OptionBuilder<>("log-syslog-max-length", MemorySize.class) + .category(OptionCategory.LOGGING) + // based on the 'quarkus.log.syslog.max-length' property + .description("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 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when 'log-syslog-type' is rfc3164.") + .build(); + public static final Option LOG_SYSLOG_APP_NAME = new OptionBuilder<>("log-syslog-app-name", String.class) .category(OptionCategory.LOGGING) - .description("The app name used when formatting the message in RFC5424 format.") + .description("Set the app name used when formatting the message in RFC5424 format.") .defaultValue("keycloak") .build(); public static final Option LOG_SYSLOG_PROTOCOL = new OptionBuilder<>("log-syslog-protocol", String.class) .category(OptionCategory.LOGGING) - .description("Sets the protocol used to connect to the syslog server.") + .description("Set the protocol used to connect to the Syslog server.") .defaultValue("tcp") .expectedValues("tcp", "udp", "ssl-tcp") .build(); public static final Option LOG_SYSLOG_FORMAT = new OptionBuilder<>("log-syslog-format", String.class) .category(OptionCategory.LOGGING) - .description("Set a format specific to syslog entries.") + .description("Set a format specific to Syslog entries.") .defaultValue(DEFAULT_LOG_FORMAT) .build(); public static final Option LOG_SYSLOG_INCLUDE_TRACE = new OptionBuilder<>("log-syslog-include-trace", Boolean.class) .category(OptionCategory.LOGGING) - .description(format("Include tracing information in the syslog. If the '%s' option is specified, this option has no effect.", LOG_SYSLOG_FORMAT.getKey())) + .description(format("Include tracing information in the Syslog. If the '%s' option is specified, this option has no effect.", LOG_SYSLOG_FORMAT.getKey())) .defaultValue(true) .build(); public static final Option LOG_SYSLOG_OUTPUT = new OptionBuilder<>("log-syslog-output", Output.class) .category(OptionCategory.LOGGING) .defaultValue(DEFAULT_SYSLOG_OUTPUT) - .description("Set the syslog output to JSON or default (plain) unstructured logging.") + .description("Set the Syslog output to JSON or default (plain) unstructured logging.") .build(); } diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java index 22cde523ec..7ab19cb9a8 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java @@ -142,6 +142,10 @@ public final class Configuration { return getOptionalValue(NS_KEYCLOAK_PREFIX.concat(propertyName)); } + public static Optional getOptionalKcValue(Option option) { + return getOptionalKcValue(option.getKey()); + } + public static Optional getOptionalBooleanKcValue(String propertyName) { return getOptionalValue(NS_KEYCLOAK_PREFIX.concat(propertyName)).map(Boolean::parseBoolean); } 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 7aee0060b6..4307e6cc3a 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 @@ -15,7 +15,6 @@ import java.util.stream.Stream; import org.jboss.logmanager.LogContext; import org.keycloak.config.LoggingOptions; import org.keycloak.config.Option; -import org.keycloak.config.TracingOptions; import org.keycloak.quarkus.runtime.Messages; import org.keycloak.quarkus.runtime.cli.PropertyException; @@ -113,6 +112,16 @@ public final class LoggingPropertyMappers { .to("quarkus.log.syslog.app-name") .paramLabel("name") .build(), + fromOption(LoggingOptions.LOG_SYSLOG_TYPE) + .isEnabled(LoggingPropertyMappers::isSyslogEnabled, SYSLOG_ENABLED_MSG) + .to("quarkus.log.syslog.syslog-type") + .paramLabel("type") + .build(), + fromOption(LoggingOptions.LOG_SYSLOG_MAX_LENGTH) + .isEnabled(LoggingPropertyMappers::isSyslogEnabled, SYSLOG_ENABLED_MSG) + .to("quarkus.log.syslog.max-length") + .paramLabel("max-length") + .build(), fromOption(LoggingOptions.LOG_SYSLOG_PROTOCOL) .isEnabled(LoggingPropertyMappers::isSyslogEnabled, SYSLOG_ENABLED_MSG) .to("quarkus.log.syslog.protocol") 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 fbcdc4d945..5fac5c23b1 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 @@ -430,71 +430,6 @@ public class ConfigurationTest extends AbstractConfigurationTest { assertEquals("true", config.getConfigValue("quarkus.datasource.metrics.enabled").getValue()); } - @Test - public void testLogHandlerConfig() { - ConfigArgsConfigSource.setCliArgs("--log=console,file"); - SmallRyeConfig config = createConfig(); - assertEquals("true", config.getConfigValue("quarkus.log.console.enable").getValue()); - assertEquals("true", config.getConfigValue("quarkus.log.file.enable").getValue()); - assertEquals("false", config.getConfigValue("quarkus.log.syslog.enable").getValue()); - - ConfigArgsConfigSource.setCliArgs("--log=file"); - SmallRyeConfig config2 = createConfig(); - assertEquals("false", config2.getConfigValue("quarkus.log.console.enable").getValue()); - assertEquals("true", config2.getConfigValue("quarkus.log.file.enable").getValue()); - assertEquals("false", config2.getConfigValue("quarkus.log.syslog.enable").getValue()); - - ConfigArgsConfigSource.setCliArgs("--log=console"); - SmallRyeConfig config3 = createConfig(); - assertEquals("true", config3.getConfigValue("quarkus.log.console.enable").getValue()); - assertEquals("false", config3.getConfigValue("quarkus.log.file.enable").getValue()); - assertEquals("false", config3.getConfigValue("quarkus.log.syslog.enable").getValue()); - - ConfigArgsConfigSource.setCliArgs("--log=console,syslog"); - SmallRyeConfig config5 = createConfig(); - assertEquals("true", config5.getConfigValue("quarkus.log.console.enable").getValue()); - assertEquals("false", config5.getConfigValue("quarkus.log.file.enable").getValue()); - assertEquals("true", config5.getConfigValue("quarkus.log.syslog.enable").getValue()); - - ConfigArgsConfigSource.setCliArgs("--log=syslog"); - SmallRyeConfig config6 = createConfig(); - assertEquals("false", config6.getConfigValue("quarkus.log.console.enable").getValue()); - assertEquals("false", config6.getConfigValue("quarkus.log.file.enable").getValue()); - assertEquals("true", config6.getConfigValue("quarkus.log.syslog.enable").getValue()); - } - - @Test - public void testSyslogProperties() { - putEnvVars(Map.of( - "KC_LOG", "syslog", - "KC_LOG_SYSLOG_ENDPOINT", "192.168.0.42:515", - "KC_LOG_SYSLOG_APP_NAME", "keycloak2", - "KC_LOG_SYSLOG_PROTOCOL", "udp", - "KC_LOG_SYSLOG_FORMAT", "some format", - "KC_LOG_SYSLOG_OUTPUT", "json" - )); - - initConfig(); - - assertConfig(Map.of( - "log-syslog-enabled", "true", - "log-syslog-endpoint", "192.168.0.42:515", - "log-syslog-app-name", "keycloak2", - "log-syslog-protocol", "udp", - "log-syslog-format", "some format", - "log-syslog-output", "json" - )); - - assertExternalConfig(Map.of( - "quarkus.log.syslog.enable", "true", - "quarkus.log.syslog.endpoint", "192.168.0.42:515", - "quarkus.log.syslog.app-name", "keycloak2", - "quarkus.log.syslog.protocol", "udp", - "quarkus.log.syslog.format", "some format", - "quarkus.log.syslog.json", "true" - )); - } - @Test public void testOptionValueWithEqualSign() { ConfigArgsConfigSource.setCliArgs("--db=postgres", "--db-password=my_secret="); 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 new file mode 100644 index 0000000000..d79ba8b286 --- /dev/null +++ b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/LoggingConfigurationTest.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.configuration.test; + +import io.smallrye.config.SmallRyeConfig; +import org.hamcrest.CoreMatchers; +import org.junit.Test; +import org.keycloak.config.LoggingOptions; +import org.keycloak.quarkus.runtime.configuration.ConfigArgsConfigSource; +import org.keycloak.quarkus.runtime.configuration.Configuration; + +import java.util.Map; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.keycloak.config.LoggingOptions.DEFAULT_LOG_FORMAT; +import static org.keycloak.config.LoggingOptions.DEFAULT_SYSLOG_OUTPUT; + +public class LoggingConfigurationTest extends AbstractConfigurationTest { + + @Test + public void logHandlerConfig() { + ConfigArgsConfigSource.setCliArgs("--log=console,file"); + SmallRyeConfig config = createConfig(); + assertEquals("true", config.getConfigValue("quarkus.log.console.enable").getValue()); + assertEquals("true", config.getConfigValue("quarkus.log.file.enable").getValue()); + assertEquals("false", config.getConfigValue("quarkus.log.syslog.enable").getValue()); + + ConfigArgsConfigSource.setCliArgs("--log=file"); + SmallRyeConfig config2 = createConfig(); + assertEquals("false", config2.getConfigValue("quarkus.log.console.enable").getValue()); + assertEquals("true", config2.getConfigValue("quarkus.log.file.enable").getValue()); + assertEquals("false", config2.getConfigValue("quarkus.log.syslog.enable").getValue()); + + ConfigArgsConfigSource.setCliArgs("--log=console"); + SmallRyeConfig config3 = createConfig(); + assertEquals("true", config3.getConfigValue("quarkus.log.console.enable").getValue()); + assertEquals("false", config3.getConfigValue("quarkus.log.file.enable").getValue()); + assertEquals("false", config3.getConfigValue("quarkus.log.syslog.enable").getValue()); + + ConfigArgsConfigSource.setCliArgs("--log=console,syslog"); + SmallRyeConfig config5 = createConfig(); + assertEquals("true", config5.getConfigValue("quarkus.log.console.enable").getValue()); + assertEquals("false", config5.getConfigValue("quarkus.log.file.enable").getValue()); + assertEquals("true", config5.getConfigValue("quarkus.log.syslog.enable").getValue()); + + ConfigArgsConfigSource.setCliArgs("--log=syslog"); + SmallRyeConfig config6 = createConfig(); + assertEquals("false", config6.getConfigValue("quarkus.log.console.enable").getValue()); + assertEquals("false", config6.getConfigValue("quarkus.log.file.enable").getValue()); + assertEquals("true", config6.getConfigValue("quarkus.log.syslog.enable").getValue()); + } + + @Test + public void syslogDefaults() { + initConfig(); + + assertConfig(Map.of( + "log-syslog-enabled", "false", + "log-syslog-endpoint", "localhost:514", + "log-syslog-type", "rfc5424", + "log-syslog-app-name", "keycloak", + "log-syslog-protocol", "tcp", + "log-syslog-format", DEFAULT_LOG_FORMAT, + "log-syslog-output", DEFAULT_SYSLOG_OUTPUT.toString() + )); + assertThat(Configuration.getOptionalKcValue(LoggingOptions.LOG_SYSLOG_MAX_LENGTH).orElse(null), CoreMatchers.nullValue()); + + assertExternalConfig(Map.of( + "quarkus.log.syslog.enable", "false", + "quarkus.log.syslog.endpoint", "localhost:514", + "quarkus.log.syslog.syslog-type", "rfc5424", + "quarkus.log.syslog.app-name", "keycloak", + "quarkus.log.syslog.protocol", "tcp", + "quarkus.log.syslog.format", DEFAULT_LOG_FORMAT, + "quarkus.log.syslog.json", "false" + )); + + // The default max-length attribute is set in the org.jboss.logmanager.handlers.SyslogHandler if not specified in config + assertThat(Configuration.getOptionalValue("quarkus.log.syslog.max-length").orElse(null), CoreMatchers.nullValue()); + } + + @Test + public void syslogDifferentValues() { + putEnvVars(Map.of( + "KC_LOG", "syslog", + "KC_LOG_SYSLOG_ENDPOINT", "192.168.0.42:515", + "KC_LOG_SYSLOG_TYPE", "rfc3164", + "KC_LOG_SYSLOG_MAX_LENGTH", "4096", + "KC_LOG_SYSLOG_APP_NAME", "keycloak2", + "KC_LOG_SYSLOG_PROTOCOL", "udp", + "KC_LOG_SYSLOG_FORMAT", "some format", + "KC_LOG_SYSLOG_OUTPUT", "json" + )); + + initConfig(); + + assertConfig(Map.of( + "log-syslog-enabled", "true", + "log-syslog-endpoint", "192.168.0.42:515", + "log-syslog-type", "rfc3164", + "log-syslog-max-length", "4096", + "log-syslog-app-name", "keycloak2", + "log-syslog-protocol", "udp", + "log-syslog-format", "some format", + "log-syslog-output", "json" + )); + + assertExternalConfig(Map.of( + "quarkus.log.syslog.enable", "true", + "quarkus.log.syslog.endpoint", "192.168.0.42:515", + "quarkus.log.syslog.syslog-type", "rfc3164", + "quarkus.log.syslog.max-length", "4096", + "quarkus.log.syslog.app-name", "keycloak2", + "quarkus.log.syslog.protocol", "udp", + "quarkus.log.syslog.format", "some format", + "quarkus.log.syslog.json", "true" + )); + } + + @Test + public void syslogMaxLength() { + // RFC3164 + putEnvVar("KC_LOG_SYSLOG_TYPE", "rfc3164"); + initConfig(); + + assertConfig("log-syslog-type", "rfc3164"); + assertThat(Configuration.getOptionalKcValue(LoggingOptions.LOG_SYSLOG_MAX_LENGTH).orElse(null), CoreMatchers.nullValue()); + assertThat(Configuration.getOptionalValue("quarkus.log.syslog.max-length").orElse(null), CoreMatchers.nullValue()); + + // RFC5424 + putEnvVar("KC_LOG_SYSLOG_TYPE", "rfc5424"); + initConfig(); + + assertThat(Configuration.getOptionalKcValue(LoggingOptions.LOG_SYSLOG_MAX_LENGTH).orElse(null), CoreMatchers.nullValue()); + assertThat(Configuration.getOptionalValue("quarkus.log.syslog.max-length").orElse(null), CoreMatchers.nullValue()); + + // Specific max-length + removeEnvVar("KC_LOG_SYSLOG_TYPE"); + putEnvVar("KC_LOG_SYSLOG_MAX_LENGTH", "512"); + initConfig(); + + assertConfig("log-syslog-max-length", "512"); + assertExternalConfig("quarkus.log.syslog.max-length", "512"); + } +} 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 afdff5906c..63487aeed2 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 @@ -154,25 +154,33 @@ Logging: categories and their levels. For the root category, you don't need to specify a category. Default: info. --log-syslog-app-name - The app name used when formatting the message in RFC5424 format. Default: + Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. --log-syslog-endpoint - The IP address and port of the syslog server. Default: localhost:514. + Set the IP address and port of the Syslog server. Default: localhost:514. Available only when Syslog is activated. --log-syslog-format - Set a format specific to syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % + Set a format specific to Syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Syslog is activated. --log-syslog-include-trace - Include tracing information in the syslog. If the 'log-syslog-format' option + 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-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 + 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when + 'log-syslog-type' is rfc3164. Available only when Syslog is activated. --log-syslog-output - Set the syslog output to JSON or default (plain) unstructured logging. + Set the Syslog output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Syslog is activated. --log-syslog-protocol - Sets the protocol used to connect to the syslog server. Possible values are: + Set the protocol used to connect to the Syslog server. Possible values are: tcp, udp, ssl-tcp. Default: tcp. Available only when Syslog is activated. +--log-syslog-type + Set the Syslog type used to format the sent message. Possible values are: + rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. Tracing (Preview): 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 cc574131b8..5c86e18182 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 @@ -154,25 +154,33 @@ Logging: categories and their levels. For the root category, you don't need to specify a category. Default: info. --log-syslog-app-name - The app name used when formatting the message in RFC5424 format. Default: + Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. --log-syslog-endpoint - The IP address and port of the syslog server. Default: localhost:514. + Set the IP address and port of the Syslog server. Default: localhost:514. Available only when Syslog is activated. --log-syslog-format - Set a format specific to syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % + Set a format specific to Syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Syslog is activated. --log-syslog-include-trace - Include tracing information in the syslog. If the 'log-syslog-format' option + 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-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 + 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when + 'log-syslog-type' is rfc3164. Available only when Syslog is activated. --log-syslog-output - Set the syslog output to JSON or default (plain) unstructured logging. + Set the Syslog output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Syslog is activated. --log-syslog-protocol - Sets the protocol used to connect to the syslog server. Possible values are: + Set the protocol used to connect to the Syslog server. Possible values are: tcp, udp, ssl-tcp. Default: tcp. Available only when Syslog is activated. +--log-syslog-type + Set the Syslog type used to format the sent message. Possible values are: + rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. Tracing (Preview): 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 41b71857cc..f8ddb55062 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 @@ -330,25 +330,33 @@ Logging: categories and their levels. For the root category, you don't need to specify a category. Default: info. --log-syslog-app-name - The app name used when formatting the message in RFC5424 format. Default: + Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. --log-syslog-endpoint - The IP address and port of the syslog server. Default: localhost:514. + Set the IP address and port of the Syslog server. Default: localhost:514. Available only when Syslog is activated. --log-syslog-format - Set a format specific to syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % + Set a format specific to Syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Syslog is activated. --log-syslog-include-trace - Include tracing information in the syslog. If the 'log-syslog-format' option + 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-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 + 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when + 'log-syslog-type' is rfc3164. Available only when Syslog is activated. --log-syslog-output - Set the syslog output to JSON or default (plain) unstructured logging. + Set the Syslog output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Syslog is activated. --log-syslog-protocol - Sets the protocol used to connect to the syslog server. Possible values are: + Set the protocol used to connect to the Syslog server. Possible values are: tcp, udp, ssl-tcp. Default: tcp. Available only when Syslog is activated. +--log-syslog-type + Set the Syslog type used to format the sent message. Possible values are: + rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. Tracing (Preview): 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 9bdbc909e4..f5268bec6e 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 @@ -331,25 +331,33 @@ Logging: categories and their levels. For the root category, you don't need to specify a category. Default: info. --log-syslog-app-name - The app name used when formatting the message in RFC5424 format. Default: + Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. --log-syslog-endpoint - The IP address and port of the syslog server. Default: localhost:514. + Set the IP address and port of the Syslog server. Default: localhost:514. Available only when Syslog is activated. --log-syslog-format - Set a format specific to syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % + Set a format specific to Syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Syslog is activated. --log-syslog-include-trace - Include tracing information in the syslog. If the 'log-syslog-format' option + 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-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 + 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when + 'log-syslog-type' is rfc3164. Available only when Syslog is activated. --log-syslog-output - Set the syslog output to JSON or default (plain) unstructured logging. + Set the Syslog output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Syslog is activated. --log-syslog-protocol - Sets the protocol used to connect to the syslog server. Possible values are: + Set the protocol used to connect to the Syslog server. Possible values are: tcp, udp, ssl-tcp. Default: tcp. Available only when Syslog is activated. +--log-syslog-type + Set the Syslog type used to format the sent message. Possible values are: + rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. Tracing (Preview): 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 3896daa6df..a0c836c371 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 @@ -282,25 +282,33 @@ Logging: categories and their levels. For the root category, you don't need to specify a category. Default: info. --log-syslog-app-name - The app name used when formatting the message in RFC5424 format. Default: + Set the app name used when formatting the message in RFC5424 format. Default: keycloak. Available only when Syslog is activated. --log-syslog-endpoint - The IP address and port of the syslog server. Default: localhost:514. + Set the IP address and port of the Syslog server. Default: localhost:514. Available only when Syslog is activated. --log-syslog-format - Set a format specific to syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % + Set a format specific to Syslog entries. Default: %d{yyyy-MM-dd HH:mm:ss,SSS} % -5p [%c] (%t) %s%e%n. Available only when Syslog is activated. --log-syslog-include-trace - Include tracing information in the syslog. If the 'log-syslog-format' option + 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-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 + 2048 when 'log-syslog-type' is rfc5424 (default) and 1024 when + 'log-syslog-type' is rfc3164. Available only when Syslog is activated. --log-syslog-output - Set the syslog output to JSON or default (plain) unstructured logging. + Set the Syslog output to JSON or default (plain) unstructured logging. Possible values are: default, json. Default: default. Available only when Syslog is activated. --log-syslog-protocol - Sets the protocol used to connect to the syslog server. Possible values are: + Set the protocol used to connect to the Syslog server. Possible values are: tcp, udp, ssl-tcp. Default: tcp. Available only when Syslog is activated. +--log-syslog-type + Set the Syslog type used to format the sent message. Possible values are: + rfc5424, rfc3164. Default: rfc5424. Available only when Syslog is activated. Tracing (Preview):