Remove GELF (#32230)

Closes #27365

Signed-off-by: Václav Muzikář <vmuzikar@redhat.com>
This commit is contained in:
Václav Muzikář 2024-08-28 21:25:05 +02:00 committed by GitHub
parent 37f42430e6
commit 9bbfec5cdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 45 additions and 821 deletions

View file

@ -143,3 +143,9 @@ The deprecated `proxy` option was removed. This option was deprecated in {projec
The `origin` property in the `UserRepresentation` is deprecated and planned to be removed in future releases. The `origin` property in the `UserRepresentation` is deprecated and planned to be removed in future releases.
Instead, prefer using the `federationLink` property to obtain the provider to which a user is linked with. Instead, prefer using the `federationLink` property to obtain the provider to which a user is linked with.
= Removal of GELF logging handler
GELF support has been deprecated for a while now, and with this release it has been finally removed from {project_name}.
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].

View file

@ -168,6 +168,12 @@ on the console during migration. In this case, the statements must be run manual
Also, the `kc.org` and `hideOnLoginPage` configuration attributes were migrated to the identity provider itself, to allow for more efficient queries when searching for providers. As such, API clients should use the `getOrganizationId/setOrganizationId` and `isHideOnLogin/setHideOnLogin` methods in the `IdentityProviderRepresentation`, and avoid setting these properties using the legacy config attributes that are now deprecated. Also, the `kc.org` and `hideOnLoginPage` configuration attributes were migrated to the identity provider itself, to allow for more efficient queries when searching for providers. As such, API clients should use the `getOrganizationId/setOrganizationId` and `isHideOnLogin/setHideOnLogin` methods in the `IdentityProviderRepresentation`, and avoid setting these properties using the legacy config attributes that are now deprecated.
= Removal of GELF logging handler
GELF support has been deprecated for a while now, and with this release it has been finally removed from {project_name}.
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].
= Paths for `common` theme resources have changed = Paths for `common` theme resources have changed
Some of the paths for the `common` resources of the `keycloak` theme have changed, specifically the resources for third-party libraries. Make sure to update your custom themes accordingly: Some of the paths for the `common` resources of the `keycloak` theme have changed, specifically the resources for third-party libraries. Make sure to update your custom themes accordingly:

View file

@ -14,9 +14,6 @@ includedOptions="log log-*">
** console (_default_) ** console (_default_)
** file ** file
** Syslog ** Syslog
<@profile.ifCommunity>
** GELF
</@profile.ifCommunity>
== Logging configuration == 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`. This {section} describes how to configure logging.
@ -75,7 +72,7 @@ To enable log handlers, enter the following command:
The available handlers are The available handlers are
<@profile.ifCommunity> <@profile.ifCommunity>
`console`, `file`, `syslog` and `gelf`. `console`, `file`, `syslog`.
</@profile.ifCommunity> </@profile.ifCommunity>
<@profile.ifProduct> <@profile.ifProduct>
`console`, `file` and `syslog`. `console`, `file` and `syslog`.
@ -257,331 +254,4 @@ To use unstructured logging, enter the following command:
As you can see, the timestamp is present twice, so you can amend it correspondingly via the `--log-syslog-format` property. As you can see, the timestamp is present twice, so you can amend it correspondingly via the `--log-syslog-format` property.
<@profile.ifCommunity>
== Centralized logging using GELF
NOTE: The support for GELF log handler is deprecated and will be removed in a future {project_name} release.
The recommended alternative is using the Syslog log handler described above.
{project_name} can send logs to a centralized log management system such as the following:
* Graylog
* Logstash, inside the Elasticsearch, Logstash, Kibana (ELK) logging stack
* Fluentd, inside the Elasticsearch, Fluentd, Kibana (EFK) logging stack
{project_name} uses the https://quarkus.io/guides/centralized-log-management[Quarkus Logging GELF] extension to support these environments.
=== Enabling the GELF handler
To enable logging using GELF, add it to the list of activated log handlers.
.Example:
<@kc.start parameters="--log=\"console,gelf\""/>
=== Configuring the GELF handler
To configure the Host and Port of your centralized logging system, enter the following command and substitute the values with your specific values:
.Host and port of the GELF server:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-host=myhost --log-gelf-port=12345"/>
When the GELF handler is enabled, the host is using `localhost` as host value and UDP for communication. To use TCP instead of UDP, prefix the host value with `tcp:`. The Default port is `12201`.
.Include or exclude Stacktraces
{project_name} includes the complete Stacktrace inside the `StackTrace` field. To exclude this field, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-include-stack-trace=false"/>
.Configure the timestamp format
You can change the format of the `timestamp` field. For example, you can include the date and time down to seconds by entering the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-timestamp-format=\"\'yyyy-MM-dd HH:mm:ss\'\""/>
Alternatively, you could use the config file to avoid escaping:
[source, conf]
----
log-gelf-timestamp-format=yyyy-MM-dd HH:mm:ss
----
The default timestamp format is `yyyy-MM-dd HH:mm:ss,SSS`. You can use the https://docs.oracle.com/javase/10/docs/api/java/text/SimpleDateFormat.html[available SimpleDateFormat patterns] to define an appropriate timestamp.
.Configure the facility
The `facility` field is an indicator of the process or program that is the source of log messages. The default value is `keycloak`. To set this field to your preferred identifier, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-facility=MyKeycloak"/>
To use the CLI to configure {project_name} and use whitespaces for `facility`, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-facility=\"\'my keycloak\'\""/>
Alternatively, you could use the config file to avoid escaping:
[source, conf]
----
log-gelf-facility=my keycloak
----
.Configure the default message size
To change the default message size of 8kb (8192 bytes) of GELF log messages for {project_name}, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-max-message-size=16384"/>
The maximum size of one GELF log message is set in Bytes. The preceding example increases the size to 16kb. When messages exceed the maximum size, GELF submits the message in multiple chunks.
.Configure sending of message parameters
{project_name} includes message parameters of the occurred log event. These fields appear in the output as `MessageParam0`, `MessageParam1`, and so on, depending on the parameter length.
To switch off this behavior, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-include-message-parameters=false"/>
.Configure sending of source code location
{project_name} includes the `SourceClassName`, `SourceMethodName` and `SourceSimpleClassName` fields in the GELF log messages. These fields provide detail on the location of an exception that occurred. To stop sending these fields, enter the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-gelf-include-location=false"/>
=== Example: Send logs to Graylog
The following example shows how to send {project_name} logs to the Graylog centralized logging stack. This example assumes you have a container tool such as https://www.docker.com/[docker] installed to start the `compose.yml`.
==== Starting the Graylog stack
The composed stack consists of:
* Graylog
* ElasticSearch
* MongoDB
[source, yaml]
----
version: '3.8'
services:
elasticsearch:
image: docker.io/elastic/elasticsearch:7.10.2
ports:
- "9200:9200"
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
discovery.type: "single-node"
networks:
- graylog
mongo:
image: mongo:4.4
networks:
- graylog
graylog:
image: graylog/graylog:4.3.3
ports:
- "9000:9000"
- "12201:12201/udp"
- "1514:1514"
environment:
GRAYLOG_HTTP_EXTERNAL_URI: "http://127.0.0.1:9000/"
# CHANGE ME (must be at least 16 characters)!
GRAYLOG_PASSWORD_SECRET: "forpasswordencryption"
# Password: admin
GRAYLOG_ROOT_PASSWORD_SHA2: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"
networks:
- graylog
depends_on:
- elasticsearch
- mongo
networks:
graylog:
driver: bridge
----
Copy and save the example locally into a `compose.yml` file and enter this command:
[source,bash]
----
docker compose up -d
----
After a few seconds, the Stack is ready to serve requests.
==== Creating a Graylog UDP Input
Once the stack is running, you need to create a UDP Input Graylog listens to. You can create it from the Graylog web UI (System → Input → Select GELF UDP) available at http://localhost:9000 or using the API:
This `curl` example creates a new GELF UDP Input using the API and the default Graylog login credentials (admin/admin).
[source, bash]
----
curl -H "Content-Type: application/json" -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "X-Requested-By: curl" -X POST -v -d \
'{"title":"udp input","configuration":{"recv_buffer_size":262144,"bind_address":"0.0.0.0","port":12201,"decompress_size_limit":8388608},"type":"org.graylog2.inputs.gelf.udp.GELFUDPInput","global":true}' \
http://localhost:9000/api/system/inputs
----
If the stack is still in the bootstrap phase, you receive a response containing `* Empty reply from server`. A successful response includes `HTTP/1.1 201 Created` to indicate that the UDP input is created.
==== Configure {project_name} to send logs using GELF
{project_name} needs to be configured to send logs using GELF. The appropriate configuration can be seen in the following keycloak.conf example. The example includes the `log-gelf-host` and `log-gelf-port` values. These are optional values that are included for illustration purposes; default values exist.
.{project_name} GELF Configuration
[source, conf]
----
log=console,gelf
log-gelf-host=localhost
log-gelf-port=12201
----
==== Graylog: See the results
. Open your web browser, go to `http://localhost:9000`.
. Log in to the Graylog web UI using the administrator credentials (admin/admin).
. Go to Streams, All Messages.
. Start updating the stream by pressing the Play button in the upper right corner.
. Start {project_name} using `start` or `start-dev` and your GELF config.
After a few seconds, {project_name} messages appear in the Graylog dashboard.
=== Example Setup using the ELK Stack
The following example shows how to send {project_name} logs to the ELK centralized logging stack. It assumes you have a container tool such as https://www.docker.com/[docker] installed to start the `compose.yml`.
==== Enable the logstash GELF plugin and create a pipeline
Logstash uses an input plugin that understands and parses the GELF format. To activate this plugin when you are starting the ELK stack later on, create a directory `pipelines` and a file `gelf.conf` located in this directory. Then create an empty `compose.yml` in the parent directory.
.File Structure:
[source]
----
/ELK
- compose.yml
- pipelines/
- gelf.conf
----
Add the following contents to `pipelines/gelf.conf` and save it:
[source, conf]
----
input {
gelf {
port => 12201
}
}
output {
stdout {}
elasticsearch {
hosts => ["http://elasticsearch:9200"]
}
}
----
This file activates and configures the logstash GELF plugin and points it to the right elasticsearch instance.
==== Starting the ELK stack
The composed stack consists of:
* ElasticSearch
* Logstash
* Kibana
Copy the following content to your `compose.yml` file:
[source, yaml]
----
# Launch Elasticsearch
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.2
ports:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
networks:
- elk
logstash:
image: docker.elastic.co/logstash/logstash-oss:6.8.2
volumes:
- source: ./pipelines #the source dir gelf.conf resides
target: /usr/share/logstash/pipeline
type: bind
ports:
- "12201:12201/udp"
- "5000:5000"
- "9600:9600"
networks:
- elk
depends_on:
- elasticsearch
kibana:
image: docker.elastic.co/kibana/kibana-oss:6.8.2
ports:
- "5601:5601"
networks:
- elk
depends_on:
- elasticsearch
networks:
elk:
driver: bridge
----
Start the stack by entering the following command:
[source, bash]
----
docker compose up -d
----
After a few seconds the Stack should be ready to serve requests.
==== Configuring {project_name} to send logs using GELF
{project_name} needs to be configured to send logs using GELF. The appropriate configuration can be seen in the following keycloak.conf example. This example includes the `log-gelf-host` and `log-gelf-port` values. These are optional values, which are included for illustration purposes; default values exist.
.{project_name} Gelf Configuration
[source, conf]
----
log=console,gelf
log-gelf-host=localhost
log-gelf-port=12201
----
With this configuration applied, start {project_name} using `start-dev` or `start`.
==== Kibana: See the results
Open http://localhost:5601 to reach the Kibana dashboard. The exact configuration of a good monitoring dashboard is out of scope for this {section}. To find out if logs sent by {project_name} are delivered to Kibana, open the http://localhost:5601/app/kibana#/dev_tools/console?_g=()[Dev Tools] and execute the default `match_all` query. The logs should appear in the result field.
=== Configure a different log level for the GELF logger
To keep log storage costs and verbosity low, it is often wanted to only store a subset of the verbose application logs inside a centralized log management system. To configure {project_name} to use a different log level for the logs you want to ingest, use the following configuration:
[source, conf]
----
log=console,gelf
log-gelf-level=<desired-log-level>
...
----
.Example
To only see occurred log levels of warn and above in your centralized logging stack, but still see INFO level logs on the applications console logs, use the following configuration:
[source, conf]
----
log=console,gelf
log-level=INFO
log-gelf-level=warn
...
----
Looking at your ingested logs, you will see only messages of level warn or above will appear.
Keep in mind that `--log-level` is setting the leading log level, so for example when you invoke the following command:
<@kc.start parameters="--log=\"console,gelf\" --log-level=error --log-gelf-level=info"/>
nothing below the error level will be sent to your logging stack. That means that even GELF in this example will receive only error level log messages.
=== Configure additional key values
Currently, the {project_name} configuration does not support partly dynamic configuration keys, as they are used in quarkus properties. For example, they are used when defining `quarkus.log.handler.gelf.additional-field.<my-name>.value`.
To add user-defined fields, you can provide these fields through a quarkus.properties file. See <@links.server id="configuration"/> and the _Using raw Quarkus properties_ section.
</@profile.ifCommunity>
</@tmpl.guide> </@tmpl.guide>

View file

@ -18,7 +18,6 @@ public class LoggingOptions {
public static final Output DEFAULT_SYSLOG_OUTPUT = Output.DEFAULT; public static final Output DEFAULT_SYSLOG_OUTPUT = Output.DEFAULT;
public static final String DEFAULT_LOG_FILENAME = "keycloak.log"; public static final String DEFAULT_LOG_FILENAME = "keycloak.log";
public static final String DEFAULT_LOG_PATH = "data" + File.separator + "log" + File.separator + DEFAULT_LOG_FILENAME; public static final String DEFAULT_LOG_PATH = "data" + File.separator + "log" + File.separator + DEFAULT_LOG_FILENAME;
public static final Boolean GELF_ACTIVATED = isGelfActivated();
// Log format + tracing // Log format + tracing
private static final Function<String, String> DEFAULT_LOG_FORMAT_FUNC = (additionalFields) -> private static final Function<String, String> DEFAULT_LOG_FORMAT_FUNC = (additionalFields) ->
@ -29,34 +28,14 @@ public class LoggingOptions {
public enum Handler { public enum Handler {
console, console,
file, file,
syslog, syslog
gelf
} }
public static List<String> getAvailableHandlerNames() { public static final Option<List<Handler>> LOG = OptionBuilder.listOptionBuilder("log", Handler.class)
final Predicate<Handler> checkGelf = (handler) -> GELF_ACTIVATED || !handler.equals(Handler.gelf);
return Arrays.stream(Handler.values())
.filter(checkGelf)
.map(Handler::name)
.toList();
}
private static Option<List<Handler>> createLogOption() {
OptionBuilder<List<Handler>> logOptionBuilder = OptionBuilder.listOptionBuilder("log", Handler.class)
.category(OptionCategory.LOGGING) .category(OptionCategory.LOGGING)
.description("Enable one or more log handlers in a comma-separated list.") .description("Enable one or more log handlers in a comma-separated list.")
.expectedValues(getAvailableHandlerNames()) .defaultValue(List.of(DEFAULT_LOG_HANDLER))
.defaultValue(Arrays.asList(DEFAULT_LOG_HANDLER)); .build();
if (GELF_ACTIVATED) {
logOptionBuilder.deprecatedValues(Set.of("gelf"), "GELF log handler has been deprecated.");
}
return logOptionBuilder.build();
}
public static final Option<List<Handler>> LOG = createLogOption();
public enum Level { public enum Level {
OFF, OFF,
@ -194,89 +173,4 @@ public class LoggingOptions {
.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(); .build();
// GELF
public static final Option<Boolean> LOG_GELF_ENABLED = new OptionBuilder<>("log-gelf-enabled", Boolean.class)
.category(OptionCategory.LOGGING)
.hidden()
.build();
public static final Option<String> LOG_GELF_LEVEL = new OptionBuilder<>("log-gelf-level", String.class)
.category(OptionCategory.LOGGING)
.defaultValue("INFO")
.description("The log level specifying which message levels will be logged by the GELF logger. Message levels lower than this value will be discarded.")
.deprecated()
.build();
public static final Option<String> LOG_GELF_HOST = new OptionBuilder<>("log-gelf-host", String.class)
.category(OptionCategory.LOGGING)
.description("Hostname of the Logstash or Graylog Host. By default UDP is used, prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'")
.defaultValue("localhost")
.deprecated()
.build();
public static final Option<Integer> LOG_GELF_PORT = new OptionBuilder<>("log-gelf-port", Integer.class)
.category(OptionCategory.LOGGING)
.description("The port the Logstash or Graylog Host is called on.")
.deprecated()
.defaultValue(12201)
.build();
public static final Option<String> LOG_GELF_VERSION = new OptionBuilder<>("log-gelf-version", String.class)
.category(OptionCategory.LOGGING)
.description("The GELF version to be used.")
.defaultValue("1.1")
.hidden()
.expectedValues("1.0", "1.1")
.build();
public static final Option<Boolean> LOG_GELF_INCLUDE_STACK_TRACE = new OptionBuilder<>("log-gelf-include-stack-trace", Boolean.class)
.category(OptionCategory.LOGGING)
.description("If set to true, occurring stack traces are included in the 'StackTrace' field in the GELF output.")
.defaultValue(Boolean.TRUE)
.deprecated()
.build();
public static final Option<String> LOG_GELF_TIMESTAMP_FORMAT = new OptionBuilder<>("log-gelf-timestamp-format", String.class)
.category(OptionCategory.LOGGING)
.description("Set the format for the GELF timestamp field. Uses Java SimpleDateFormat pattern.")
.defaultValue("yyyy-MM-dd HH:mm:ss,SSS")
.deprecated()
.build();
public static final Option<String> LOG_GELF_FACILITY = new OptionBuilder<>("log-gelf-facility", String.class)
.category(OptionCategory.LOGGING)
.description("The facility (name of the process) that sends the message.")
.defaultValue("keycloak")
.deprecated()
.build();
public static final Option<Integer> LOG_GELF_MAX_MSG_SIZE = new OptionBuilder<>("log-gelf-max-message-size", Integer.class)
.category(OptionCategory.LOGGING)
.description("Maximum message size (in bytes). If the message size is exceeded, GELF will submit the message in multiple chunks.")
.defaultValue(8192)
.deprecated()
.build();
public static final Option<Boolean> LOG_GELF_INCLUDE_LOG_MSG_PARAMS = new OptionBuilder<>("log-gelf-include-message-parameters", Boolean.class)
.category(OptionCategory.LOGGING)
.description("Include message parameters from the log event.")
.defaultValue(Boolean.TRUE)
.deprecated()
.build();
public static final Option<Boolean> LOG_GELF_INCLUDE_LOCATION = new OptionBuilder<>("log-gelf-include-location", Boolean.class)
.category(OptionCategory.LOGGING)
.description("Include source code location.")
.defaultValue(Boolean.TRUE)
.deprecated()
.build();
private static boolean isGelfActivated() {
try {
Thread.currentThread().getContextClassLoader().loadClass("io.quarkus.logging.gelf.GelfConfig");
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
} }

View file

@ -208,21 +208,4 @@
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>includeGelf</id>
<activation>
<property>
<name>!product</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-logging-gelf-deployment</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>

View file

@ -706,19 +706,5 @@
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
<profile>
<id>includeGelf</id>
<activation>
<property>
<name>!product</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-logging-gelf</artifactId>
</dependency>
</dependencies>
</profile>
</profiles> </profiles>
</project> </project>

View file

@ -2,7 +2,6 @@ package org.keycloak.quarkus.runtime.configuration.mappers;
import static java.util.Optional.of; import static java.util.Optional.of;
import static org.keycloak.config.LoggingOptions.DEFAULT_LOG_FORMAT; import static org.keycloak.config.LoggingOptions.DEFAULT_LOG_FORMAT;
import static org.keycloak.config.LoggingOptions.GELF_ACTIVATED;
import static org.keycloak.quarkus.runtime.configuration.Configuration.isTrue; import static org.keycloak.quarkus.runtime.configuration.Configuration.isTrue;
import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.fromOption; import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper.fromOption;
@ -13,7 +12,6 @@ import java.util.function.BiFunction;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.apache.commons.lang3.ArrayUtils;
import org.jboss.logmanager.LogContext; import org.jboss.logmanager.LogContext;
import org.keycloak.config.LoggingOptions; import org.keycloak.config.LoggingOptions;
import org.keycloak.config.Option; import org.keycloak.config.Option;
@ -29,7 +27,6 @@ public final class LoggingPropertyMappers {
private static final String CONSOLE_ENABLED_MSG = "Console log handler is activated"; private static final String CONSOLE_ENABLED_MSG = "Console log handler is activated";
private static final String FILE_ENABLED_MSG = "File log handler is activated"; private static final String FILE_ENABLED_MSG = "File log handler is activated";
private static final String SYSLOG_ENABLED_MSG = "Syslog is activated"; private static final String SYSLOG_ENABLED_MSG = "Syslog is activated";
private static final String GELF_ENABLED_MSG = "GELF is activated";
private LoggingPropertyMappers() { private LoggingPropertyMappers() {
} }
@ -140,68 +137,7 @@ public final class LoggingPropertyMappers {
.build(), .build(),
}; };
return GELF_ACTIVATED ? ArrayUtils.addAll(defaultMappers, getGelfMappers()) : defaultMappers; return defaultMappers;
}
public static PropertyMapper<?>[] getGelfMappers() {
return new PropertyMapper[]{
fromOption(LoggingOptions.LOG_GELF_ENABLED)
.mapFrom("log")
.to("quarkus.log.handler.gelf.enabled")
.transformer(LoggingPropertyMappers.resolveLogHandler("gelf"))
.build(),
fromOption(LoggingOptions.LOG_GELF_LEVEL)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.level")
.paramLabel("level")
.build(),
fromOption(LoggingOptions.LOG_GELF_HOST)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.host")
.paramLabel("hostname")
.build(),
fromOption(LoggingOptions.LOG_GELF_PORT)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.port")
.paramLabel("port")
.build(),
fromOption(LoggingOptions.LOG_GELF_VERSION)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.version")
.paramLabel("version")
.build(),
fromOption(LoggingOptions.LOG_GELF_INCLUDE_STACK_TRACE)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.extract-stack-trace")
.build(),
fromOption(LoggingOptions.LOG_GELF_TIMESTAMP_FORMAT)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.timestamp-pattern")
.paramLabel("pattern")
.build(),
fromOption(LoggingOptions.LOG_GELF_FACILITY)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.facility")
.paramLabel("name")
.build(),
fromOption(LoggingOptions.LOG_GELF_MAX_MSG_SIZE)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.maximum-message-size")
.paramLabel("size")
.build(),
fromOption(LoggingOptions.LOG_GELF_INCLUDE_LOG_MSG_PARAMS)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.include-log-message-parameters")
.build(),
fromOption(LoggingOptions.LOG_GELF_INCLUDE_LOCATION)
.isEnabled(LoggingPropertyMappers::isGelfEnabled, GELF_ENABLED_MSG)
.to("quarkus.log.handler.gelf.include-location")
.build()
};
}
public static boolean isGelfEnabled() {
return isTrue(LoggingOptions.LOG_GELF_ENABLED);
} }
public static boolean isConsoleEnabled() { public static boolean isConsoleEnabled() {

View file

@ -437,42 +437,30 @@ public class ConfigurationTest extends AbstractConfigurationTest {
assertEquals("true", config.getConfigValue("quarkus.log.console.enable").getValue()); assertEquals("true", config.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("true", config.getConfigValue("quarkus.log.file.enable").getValue()); assertEquals("true", config.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("false", config.getConfigValue("quarkus.log.syslog.enable").getValue()); assertEquals("false", config.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("false", config.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("--log=file"); ConfigArgsConfigSource.setCliArgs("--log=file");
SmallRyeConfig config2 = createConfig(); SmallRyeConfig config2 = createConfig();
assertEquals("false", config2.getConfigValue("quarkus.log.console.enable").getValue()); assertEquals("false", config2.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("true", config2.getConfigValue("quarkus.log.file.enable").getValue()); assertEquals("true", config2.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("false", config2.getConfigValue("quarkus.log.syslog.enable").getValue()); assertEquals("false", config2.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("false", config2.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("--log=console"); ConfigArgsConfigSource.setCliArgs("--log=console");
SmallRyeConfig config3 = createConfig(); SmallRyeConfig config3 = createConfig();
assertEquals("true", config3.getConfigValue("quarkus.log.console.enable").getValue()); assertEquals("true", config3.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("false", config3.getConfigValue("quarkus.log.file.enable").getValue()); assertEquals("false", config3.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("false", config3.getConfigValue("quarkus.log.syslog.enable").getValue()); assertEquals("false", config3.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("false", config3.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("--log=console,gelf");
SmallRyeConfig config4 = createConfig();
assertEquals("true", config4.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("false", config4.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("false", config4.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("true", config4.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("--log=console,syslog"); ConfigArgsConfigSource.setCliArgs("--log=console,syslog");
SmallRyeConfig config5 = createConfig(); SmallRyeConfig config5 = createConfig();
assertEquals("true", config5.getConfigValue("quarkus.log.console.enable").getValue()); assertEquals("true", config5.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("false", config5.getConfigValue("quarkus.log.file.enable").getValue()); assertEquals("false", config5.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("true", config5.getConfigValue("quarkus.log.syslog.enable").getValue()); assertEquals("true", config5.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("false", config5.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
ConfigArgsConfigSource.setCliArgs("--log=syslog"); ConfigArgsConfigSource.setCliArgs("--log=syslog");
SmallRyeConfig config6 = createConfig(); SmallRyeConfig config6 = createConfig();
assertEquals("false", config6.getConfigValue("quarkus.log.console.enable").getValue()); assertEquals("false", config6.getConfigValue("quarkus.log.console.enable").getValue());
assertEquals("false", config6.getConfigValue("quarkus.log.file.enable").getValue()); assertEquals("false", config6.getConfigValue("quarkus.log.file.enable").getValue());
assertEquals("true", config6.getConfigValue("quarkus.log.syslog.enable").getValue()); assertEquals("true", config6.getConfigValue("quarkus.log.syslog.enable").getValue());
assertEquals("false", config6.getConfigValue("quarkus.log.handler.gelf.enabled").getValue());
} }
@Test @Test

View file

@ -5,5 +5,3 @@ config-keystore=src/test/resources/keystore
config-keystore-password=secret config-keystore-password=secret
quarkus.log.file.path=random/path quarkus.log.file.path=random/path
log-gelf-level=WARN

View file

@ -184,26 +184,6 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>includeGelf</id>
<activation>
<property>
<name>!product</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<includeGelf>true</includeGelf>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles> </profiles>
</project> </project>

View file

@ -1,43 +0,0 @@
/*
* Copyright 2023 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.it.cli.dist;
import io.quarkus.test.junit.main.Launch;
import io.quarkus.test.junit.main.LaunchResult;
import org.junit.jupiter.api.Test;
import org.keycloak.it.junit5.extension.CLIResult;
import org.keycloak.it.junit5.extension.DistributionTest;
import org.keycloak.it.junit5.extension.RawDistOnly;
import org.keycloak.quarkus.runtime.cli.command.StartDev;
@DistributionTest
@RawDistOnly(reason = "Verifying the help message output doesn't need long spin-up of docker dist tests.")
public class GelfRemovedTest {
public static final String INCLUDE_GELF_PROPERTY = "includeGelf";
@Test
@Launch({StartDev.NAME, "--help-all"})
void checkGelfRemoved(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
if (Boolean.getBoolean(INCLUDE_GELF_PROPERTY)) {
cliResult.assertMessage("gelf");
} else {
cliResult.assertNoMessage("gelf");
}
}
}

View file

@ -18,7 +18,6 @@
package org.keycloak.it.cli.dist; package org.keycloak.it.cli.dist;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.keycloak.it.cli.dist.GelfRemovedTest.INCLUDE_GELF_PROPERTY;
import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.OPTIMIZED_BUILD_OPTION_LONG; import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.OPTIMIZED_BUILD_OPTION_LONG;
import java.io.IOException; import java.io.IOException;
@ -31,8 +30,6 @@ import org.apache.commons.io.FileUtils;
import org.approvaltests.Approvals; import org.approvaltests.Approvals;
import org.hamcrest.MatcherAssert; import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.condition.OS;
import org.keycloak.it.junit5.extension.CLIResult; import org.keycloak.it.junit5.extension.CLIResult;
@ -54,11 +51,6 @@ public class HelpCommandDistTest {
public static final String REPLACE_EXPECTED = "KEYCLOAK_REPLACE_EXPECTED"; public static final String REPLACE_EXPECTED = "KEYCLOAK_REPLACE_EXPECTED";
@BeforeAll
public static void assumeGelfEnabled() {
Assumptions.assumeTrue(Boolean.getBoolean(INCLUDE_GELF_PROPERTY), "Assume GELF support is given in order to simplify these test cases");
}
@Test @Test
@Launch({}) @Launch({})
void testDefaultToHelp(LaunchResult result) { void testDefaultToHelp(LaunchResult result) {

View file

@ -137,14 +137,14 @@ public class LoggingDistTest {
void failUnknownHandlersInConfFile(KeycloakDistribution dist) { void failUnknownHandlersInConfFile(KeycloakDistribution dist) {
dist.copyOrReplaceFileFromClasspath("/logging/keycloak.conf", Paths.get("conf", "keycloak.conf")); dist.copyOrReplaceFileFromClasspath("/logging/keycloak.conf", Paths.get("conf", "keycloak.conf"));
CLIResult cliResult = dist.run("start-dev"); CLIResult cliResult = dist.run("start-dev");
cliResult.assertError("Invalid value for option 'kc.log' in keycloak.conf: foo. Expected values are: console, file, syslog, gelf"); cliResult.assertError("Invalid value for option 'kc.log' in keycloak.conf: foo. Expected values are: console, file, syslog");
} }
@Test @Test
void failEmptyLogErrorFromConfFileError(KeycloakDistribution dist) { void failEmptyLogErrorFromConfFileError(KeycloakDistribution dist) {
dist.copyOrReplaceFileFromClasspath("/logging/emptylog.conf", Paths.get("conf", "emptylog.conf")); dist.copyOrReplaceFileFromClasspath("/logging/emptylog.conf", Paths.get("conf", "emptylog.conf"));
CLIResult cliResult = dist.run(CONFIG_FILE_LONG_NAME+"=../conf/emptylog.conf", "start-dev"); CLIResult cliResult = dist.run(CONFIG_FILE_LONG_NAME+"=../conf/emptylog.conf", "start-dev");
cliResult.assertError("Invalid value for option 'kc.log' in emptylog.conf: . Expected values are: console, file, syslog, gelf"); cliResult.assertError("Invalid value for option 'kc.log' in emptylog.conf: . Expected values are: console, file, syslog");
} }
@Test @Test

View file

@ -70,14 +70,13 @@ public class OptionsDistTest {
@Test @Test
@Order(5) @Order(5)
@WithEnvVars({"KC_LOG", "console", "KC_LOG_CONSOLE_COLOR", "true", "KC_LOG_FILE", "something-env", "KC_LOG_GELF_VERSION", "1.1", "KC_HTTP_ENABLED", "true", "KC_HOSTNAME_STRICT", "false"}) @WithEnvVars({"KC_LOG", "console", "KC_LOG_CONSOLE_COLOR", "true", "KC_LOG_FILE", "something-env", "KC_HTTP_ENABLED", "true", "KC_HOSTNAME_STRICT", "false"})
@Launch({"start"}) @Launch({"start"})
public void testSettingEnvVars(LaunchResult result) { public void testSettingEnvVars(LaunchResult result) {
CLIResult cliResult = (CLIResult) result; CLIResult cliResult = (CLIResult) result;
cliResult.assertMessage("The following used run time options are UNAVAILABLE and will be ignored during build time:"); cliResult.assertMessage("The following used run time options are UNAVAILABLE and will be ignored during build time:");
cliResult.assertMessage("- log-file: Available only when File log handler is activated."); cliResult.assertMessage("- log-file: Available only when File log handler is activated.");
cliResult.assertMessage("- log-gelf-version: Available only when GELF is activated.");
cliResult.assertMessage("quarkus.log.console.color"); cliResult.assertMessage("quarkus.log.console.color");
cliResult.assertMessage("config property is deprecated and should not be used anymore"); cliResult.assertMessage("config property is deprecated and should not be used anymore");
} }
@ -93,32 +92,21 @@ public class OptionsDistTest {
// specified in the OptionsDistTest/keycloak.conf // specified in the OptionsDistTest/keycloak.conf
result.assertMessage("The following used run time options are UNAVAILABLE and will be ignored during build time:"); result.assertMessage("The following used run time options are UNAVAILABLE and will be ignored during build time:");
result.assertMessage("- log-gelf-level: Available only when GELF is activated."); result.assertMessage("- log-syslog-protocol: Available only when Syslog is activated.");
result.assertMessage("- log-gelf-version: Available only when GELF is activated."); result.assertMessage("- log-syslog-app-name: Available only when Syslog is activated.");
}
@Test
@Order(7)
@Launch({"start-dev", "--log=console", "--log-gelf-include-stack-trace=true"})
public void testDisabledGelfOption(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
cliResult.assertError("Disabled option: '--log-gelf-include-stack-trace'. Available only when GELF is activated");
cliResult.assertError("Possible solutions: --log, --log-console-output, --log-console-format, --log-console-color, --log-level");
cliResult.assertError("Try '" + KeycloakDistribution.SCRIPT_CMD + " start-dev --help' for more information on the available options.");
cliResult.assertError("Specify '--help-all' to obtain information on all options and their availability.");
} }
// Start-dev should be executed as last tests - build is done for development mode // Start-dev should be executed as last tests - build is done for development mode
@Test @Test
@Order(8) @Order(7)
@Launch({"start-dev", "--test=invalid"}) @Launch({"start-dev", "--test=invalid"})
public void testServerDoesNotStartIfValidationFailDuringReAugStartDev(LaunchResult result) { public void testServerDoesNotStartIfValidationFailDuringReAugStartDev(LaunchResult result) {
assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Unknown option: '--test'")).count()); assertEquals(1, result.getErrorStream().stream().filter(s -> s.contains("Unknown option: '--test'")).count());
} }
@Test @Test
@Order(9) @Order(8)
@Launch({"start-dev", "--log=console", "--log-file-output=json"}) @Launch({"start-dev", "--log=console", "--log-file-output=json"})
public void testServerDoesNotStartDevIfDisabledFileLogOption(LaunchResult result) { 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("Disabled option: '--log-file-output'. Available only when File log handler is activated")).count());
@ -126,7 +114,7 @@ public class OptionsDistTest {
} }
@Test @Test
@Order(10) @Order(9)
@Launch({"start-dev", "--log=file", "--log-file-output=json", "--log-console-color=true"}) @Launch({"start-dev", "--log=file", "--log-file-output=json", "--log-console-color=true"})
public void testServerStartDevIfEnabledFileLogOption(LaunchResult result) { 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(0, result.getErrorStream().stream().filter(s -> s.contains("Disabled option: '--log-file-output'. Available only when File log handler is activated")).count());

View file

@ -135,7 +135,7 @@ public class StartCommandDistTest {
@Launch({ "start", "--optimized" }) @Launch({ "start", "--optimized" })
void testStartUsingOptimizedInvalidEnvOption(LaunchResult result) { void testStartUsingOptimizedInvalidEnvOption(LaunchResult result) {
CLIResult cliResult = (CLIResult) result; CLIResult cliResult = (CLIResult) result;
cliResult.assertError("Invalid value for option 'KC_LOG': invalid. Expected values are: console, file, syslog, gelf"); cliResult.assertError("Invalid value for option 'KC_LOG': invalid. Expected values are: console, file, syslog");
} }
@Test @Test

View file

@ -4,5 +4,5 @@ log=console,file
log-file-output=json log-file-output=json
# Ignored disabled # Ignored disabled
log-gelf-level=WARN log-syslog-protocol=udp
log-gelf-version=1.1 log-syslog-app-name=my-kc

View file

@ -119,7 +119,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.

View file

@ -119,7 +119,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.
@ -149,38 +149,6 @@ Logging:
Set the log output to JSON or default (plain) unstructured logging. Possible Set the log output to JSON or default (plain) unstructured logging. Possible
values are: default, json. Default: default. Available only when File log values are: default, json. Default: default. Available only when File log
handler is activated. handler is activated.
--log-gelf-facility <name>
DEPRECATED. The facility (name of the process) that sends the message.
Default: keycloak. Available only when GELF is activated.
--log-gelf-host <hostname>
DEPRECATED. Hostname of the Logstash or Graylog Host. By default UDP is used,
prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'
Default: localhost. Available only when GELF is activated.
--log-gelf-include-location <true|false>
DEPRECATED. Include source code location. Default: true. Available only when
GELF is activated.
--log-gelf-include-message-parameters <true|false>
DEPRECATED. Include message parameters from the log event. Default: true.
Available only when GELF is activated.
--log-gelf-include-stack-trace <true|false>
DEPRECATED. If set to true, occurring stack traces are included in the
'StackTrace' field in the GELF output. Default: true. Available only when
GELF is activated.
--log-gelf-level <level>
DEPRECATED. The log level specifying which message levels will be logged by
the GELF logger. Message levels lower than this value will be discarded.
Default: INFO. Available only when GELF is activated.
--log-gelf-max-message-size <size>
DEPRECATED. Maximum message size (in bytes). If the message size is exceeded,
GELF will submit the message in multiple chunks. Default: 8192. Available
only when GELF is activated.
--log-gelf-port <port>
DEPRECATED. The port the Logstash or Graylog Host is called on. Default:
12201. Available only when GELF is activated.
--log-gelf-timestamp-format <pattern>
DEPRECATED. Set the format for the GELF timestamp field. Uses Java
SimpleDateFormat pattern. Default: yyyy-MM-dd HH:mm:ss,SSS. Available only
when GELF is activated.
--log-level <category:level> --log-level <category:level>
The log level of the root category or a comma-separated list of individual 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 categories and their levels. For the root category, you don't need to

View file

@ -119,7 +119,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.

View file

@ -119,7 +119,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.
@ -149,38 +149,6 @@ Logging:
Set the log output to JSON or default (plain) unstructured logging. Possible Set the log output to JSON or default (plain) unstructured logging. Possible
values are: default, json. Default: default. Available only when File log values are: default, json. Default: default. Available only when File log
handler is activated. handler is activated.
--log-gelf-facility <name>
DEPRECATED. The facility (name of the process) that sends the message.
Default: keycloak. Available only when GELF is activated.
--log-gelf-host <hostname>
DEPRECATED. Hostname of the Logstash or Graylog Host. By default UDP is used,
prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'
Default: localhost. Available only when GELF is activated.
--log-gelf-include-location <true|false>
DEPRECATED. Include source code location. Default: true. Available only when
GELF is activated.
--log-gelf-include-message-parameters <true|false>
DEPRECATED. Include message parameters from the log event. Default: true.
Available only when GELF is activated.
--log-gelf-include-stack-trace <true|false>
DEPRECATED. If set to true, occurring stack traces are included in the
'StackTrace' field in the GELF output. Default: true. Available only when
GELF is activated.
--log-gelf-level <level>
DEPRECATED. The log level specifying which message levels will be logged by
the GELF logger. Message levels lower than this value will be discarded.
Default: INFO. Available only when GELF is activated.
--log-gelf-max-message-size <size>
DEPRECATED. Maximum message size (in bytes). If the message size is exceeded,
GELF will submit the message in multiple chunks. Default: 8192. Available
only when GELF is activated.
--log-gelf-port <port>
DEPRECATED. The port the Logstash or Graylog Host is called on. Default:
12201. Available only when GELF is activated.
--log-gelf-timestamp-format <pattern>
DEPRECATED. Set the format for the GELF timestamp field. Uses Java
SimpleDateFormat pattern. Default: yyyy-MM-dd HH:mm:ss,SSS. Available only
when GELF is activated.
--log-level <category:level> --log-level <category:level>
The log level of the root category or a comma-separated list of individual 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 categories and their levels. For the root category, you don't need to

View file

@ -254,7 +254,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.

View file

@ -289,7 +289,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.
@ -319,38 +319,6 @@ Logging:
Set the log output to JSON or default (plain) unstructured logging. Possible Set the log output to JSON or default (plain) unstructured logging. Possible
values are: default, json. Default: default. Available only when File log values are: default, json. Default: default. Available only when File log
handler is activated. handler is activated.
--log-gelf-facility <name>
DEPRECATED. The facility (name of the process) that sends the message.
Default: keycloak. Available only when GELF is activated.
--log-gelf-host <hostname>
DEPRECATED. Hostname of the Logstash or Graylog Host. By default UDP is used,
prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'
Default: localhost. Available only when GELF is activated.
--log-gelf-include-location <true|false>
DEPRECATED. Include source code location. Default: true. Available only when
GELF is activated.
--log-gelf-include-message-parameters <true|false>
DEPRECATED. Include message parameters from the log event. Default: true.
Available only when GELF is activated.
--log-gelf-include-stack-trace <true|false>
DEPRECATED. If set to true, occurring stack traces are included in the
'StackTrace' field in the GELF output. Default: true. Available only when
GELF is activated.
--log-gelf-level <level>
DEPRECATED. The log level specifying which message levels will be logged by
the GELF logger. Message levels lower than this value will be discarded.
Default: INFO. Available only when GELF is activated.
--log-gelf-max-message-size <size>
DEPRECATED. Maximum message size (in bytes). If the message size is exceeded,
GELF will submit the message in multiple chunks. Default: 8192. Available
only when GELF is activated.
--log-gelf-port <port>
DEPRECATED. The port the Logstash or Graylog Host is called on. Default:
12201. Available only when GELF is activated.
--log-gelf-timestamp-format <pattern>
DEPRECATED. Set the format for the GELF timestamp field. Uses Java
SimpleDateFormat pattern. Default: yyyy-MM-dd HH:mm:ss,SSS. Available only
when GELF is activated.
--log-level <category:level> --log-level <category:level>
The log level of the root category or a comma-separated list of individual 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 categories and their levels. For the root category, you don't need to

View file

@ -255,7 +255,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.

View file

@ -290,7 +290,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.
@ -320,38 +320,6 @@ Logging:
Set the log output to JSON or default (plain) unstructured logging. Possible Set the log output to JSON or default (plain) unstructured logging. Possible
values are: default, json. Default: default. Available only when File log values are: default, json. Default: default. Available only when File log
handler is activated. handler is activated.
--log-gelf-facility <name>
DEPRECATED. The facility (name of the process) that sends the message.
Default: keycloak. Available only when GELF is activated.
--log-gelf-host <hostname>
DEPRECATED. Hostname of the Logstash or Graylog Host. By default UDP is used,
prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'
Default: localhost. Available only when GELF is activated.
--log-gelf-include-location <true|false>
DEPRECATED. Include source code location. Default: true. Available only when
GELF is activated.
--log-gelf-include-message-parameters <true|false>
DEPRECATED. Include message parameters from the log event. Default: true.
Available only when GELF is activated.
--log-gelf-include-stack-trace <true|false>
DEPRECATED. If set to true, occurring stack traces are included in the
'StackTrace' field in the GELF output. Default: true. Available only when
GELF is activated.
--log-gelf-level <level>
DEPRECATED. The log level specifying which message levels will be logged by
the GELF logger. Message levels lower than this value will be discarded.
Default: INFO. Available only when GELF is activated.
--log-gelf-max-message-size <size>
DEPRECATED. Maximum message size (in bytes). If the message size is exceeded,
GELF will submit the message in multiple chunks. Default: 8192. Available
only when GELF is activated.
--log-gelf-port <port>
DEPRECATED. The port the Logstash or Graylog Host is called on. Default:
12201. Available only when GELF is activated.
--log-gelf-timestamp-format <pattern>
DEPRECATED. Set the format for the GELF timestamp field. Uses Java
SimpleDateFormat pattern. Default: yyyy-MM-dd HH:mm:ss,SSS. Available only
when GELF is activated.
--log-level <category:level> --log-level <category:level>
The log level of the root category or a comma-separated list of individual 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 categories and their levels. For the root category, you don't need to

View file

@ -206,7 +206,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.

View file

@ -241,7 +241,7 @@ Vault:
Logging: Logging:
--log <handler> Enable one or more log handlers in a comma-separated list. Possible values --log <handler> Enable one or more log handlers in a comma-separated list. Possible values
are: console, file, syslog, gelf (deprecated). Default: console. are: console, file, syslog. Default: console.
--log-console-color <true|false> --log-console-color <true|false>
Enable or disable colors when logging to console. Default: false. Available Enable or disable colors when logging to console. Default: false. Available
only when Console log handler is activated. only when Console log handler is activated.
@ -271,38 +271,6 @@ Logging:
Set the log output to JSON or default (plain) unstructured logging. Possible Set the log output to JSON or default (plain) unstructured logging. Possible
values are: default, json. Default: default. Available only when File log values are: default, json. Default: default. Available only when File log
handler is activated. handler is activated.
--log-gelf-facility <name>
DEPRECATED. The facility (name of the process) that sends the message.
Default: keycloak. Available only when GELF is activated.
--log-gelf-host <hostname>
DEPRECATED. Hostname of the Logstash or Graylog Host. By default UDP is used,
prefix the host with 'tcp:' to switch to TCP. Example: 'tcp:localhost'
Default: localhost. Available only when GELF is activated.
--log-gelf-include-location <true|false>
DEPRECATED. Include source code location. Default: true. Available only when
GELF is activated.
--log-gelf-include-message-parameters <true|false>
DEPRECATED. Include message parameters from the log event. Default: true.
Available only when GELF is activated.
--log-gelf-include-stack-trace <true|false>
DEPRECATED. If set to true, occurring stack traces are included in the
'StackTrace' field in the GELF output. Default: true. Available only when
GELF is activated.
--log-gelf-level <level>
DEPRECATED. The log level specifying which message levels will be logged by
the GELF logger. Message levels lower than this value will be discarded.
Default: INFO. Available only when GELF is activated.
--log-gelf-max-message-size <size>
DEPRECATED. Maximum message size (in bytes). If the message size is exceeded,
GELF will submit the message in multiple chunks. Default: 8192. Available
only when GELF is activated.
--log-gelf-port <port>
DEPRECATED. The port the Logstash or Graylog Host is called on. Default:
12201. Available only when GELF is activated.
--log-gelf-timestamp-format <pattern>
DEPRECATED. Set the format for the GELF timestamp field. Uses Java
SimpleDateFormat pattern. Default: yyyy-MM-dd HH:mm:ss,SSS. Available only
when GELF is activated.
--log-level <category:level> --log-level <category:level>
The log level of the root category or a comma-separated list of individual 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 categories and their levels. For the root category, you don't need to