From 3c16e2ac77263cebc1ab9dd7f8ab53c8e108a080 Mon Sep 17 00:00:00 2001 From: nxadm Date: Mon, 2 Sep 2024 12:10:15 +0200 Subject: [PATCH] Document Syslog app-name option (#32524) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #32525 Signed-off-by: Martin Bartoš Co-authored-by: Claudio Ramirez --- docs/guides/server/logging.adoc | 7 +++++++ .../src/main/java/org/keycloak/config/LoggingOptions.java | 1 - .../HelpCommandDistTest.testExportHelpAll.approved.txt | 3 +++ .../HelpCommandDistTest.testImportHelpAll.approved.txt | 3 +++ .../HelpCommandDistTest.testStartDevHelpAll.approved.txt | 3 +++ .../help/HelpCommandDistTest.testStartHelpAll.approved.txt | 3 +++ ...pCommandDistTest.testStartOptimizedHelpAll.approved.txt | 3 +++ 7 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/guides/server/logging.adoc b/docs/guides/server/logging.adoc index 63b5945f40..29c6c82458 100644 --- a/docs/guides/server/logging.adoc +++ b/docs/guides/server/logging.adoc @@ -196,6 +196,13 @@ To enable logging using Syslog, add it to the list of activated log handlers as <@kc.start parameters="--log=\"console,syslog\""/> +=== Configuring the Syslog Application Name +To set a different application name, add the `--log-syslog-app-name` option as follows: + +<@kc.start parameters="--log=\"console,syslog\" --log-syslog-app-name=kc-p-itadmins"/> + +If not set, the application name defaults to `keycloak`. + === Configuring the Syslog endpoint To configure the endpoint(_host:port_) of your centralized logging system, enter the following command and substitute the values with your specific values: 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 7e37a3a76e..70acaf1108 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 @@ -145,7 +145,6 @@ public class LoggingOptions { .category(OptionCategory.LOGGING) .description("The app name used when formatting the message in RFC5424 format.") .defaultValue("keycloak") - .hidden() .build(); public static final Option LOG_SYSLOG_PROTOCOL = new OptionBuilder<>("log-syslog-protocol", String.class) 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 a5b6fbef48..afdff5906c 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 @@ -153,6 +153,9 @@ Logging: The log level of the root category or a comma-separated list of individual 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: + keycloak. Available only when Syslog is activated. --log-syslog-endpoint The IP address and port of the syslog server. Default: localhost:514. Available only when Syslog is activated. 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 f4ffcab687..cc574131b8 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 @@ -153,6 +153,9 @@ Logging: The log level of the root category or a comma-separated list of individual 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: + keycloak. Available only when Syslog is activated. --log-syslog-endpoint The IP address and port of the syslog server. Default: localhost:514. Available only when Syslog is activated. 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 4a8c258e9b..41b71857cc 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 @@ -329,6 +329,9 @@ Logging: The log level of the root category or a comma-separated list of individual 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: + keycloak. Available only when Syslog is activated. --log-syslog-endpoint The IP address and port of the syslog server. Default: localhost:514. Available only when Syslog is activated. 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 37aa6d3b85..9bdbc909e4 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 @@ -330,6 +330,9 @@ Logging: The log level of the root category or a comma-separated list of individual 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: + keycloak. Available only when Syslog is activated. --log-syslog-endpoint The IP address and port of the syslog server. Default: localhost:514. Available only when Syslog is activated. 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 220af25640..3896daa6df 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 @@ -281,6 +281,9 @@ Logging: The log level of the root category or a comma-separated list of individual 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: + keycloak. Available only when Syslog is activated. --log-syslog-endpoint The IP address and port of the syslog server. Default: localhost:514. Available only when Syslog is activated.