Skip to content

Commit

Permalink
Merge branch 'doc/2.x/properties' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed May 3, 2024
2 parents 91c2923 + 3507a9a commit 877ef02
Show file tree
Hide file tree
Showing 27 changed files with 2,014 additions and 941 deletions.
40 changes: 21 additions & 19 deletions src/site/antora/modules/ROOT/pages/log4j-jul.adoc
Expand Up @@ -43,40 +43,42 @@ Custom Handlers should instead use an appropriate xref:manual/appenders.adoc[App
Java logging levels are translated into Log4j logging levels dynamically.
The following table lists the conversions between a Java logging level and its equivalent Log4j level.
Custom levels should be implemented as an implementation of `LevelConverter`, and the Log4j property `log4j.jul.levelConverter` must be set to your custom class name.
Custom levels should be implemented as an implementation of `LevelConverter`, and the Log4j property xref:manual/configuration.adoc#log4j2.julLevelConverter[log4j2.julLevelConverter] must be set to your custom class name.
Using the default `LevelConverter` implementation, custom logging levels are mapped to whatever the current level of the `Logger` being logged to is using.
[#default-level-conversions]
=== Default Level Conversions
.JUL to Log4j level conversion
|===
| Java Level | Log4j Level
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#OFF[`OFF`]
| `OFF`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#OFF[OFF]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#OFF[OFF]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#SEVERE[`SEVERE`]
| `ERROR`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#SEVERE[SEVERE]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#ERROR[ERROR]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#WARNING[`WARNING`]
| `WARN`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#WARNING[WARNING]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#WARN[WARN]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#INFO[`INFO`]
| `INFO`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#OFF[OFF]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#INFO[INFO]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#CONFIG[`CONFIG`]
| `CONFIG`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#CONFIG[CONFIG]
| custom `CONFIG` level
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINE[`FINE`]
| `DEBUG`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#FINE[FINE]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#DEBUG[DEBUG]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINER[`FINER`]
| `TRACE`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#FINER[FINER]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#TRACE[TRACE]
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINEST[`FINEST`]
| `FINEST`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#FINEST[FINEST]
| custom `FINEST` level
| http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#ALL[`ALL`]
| `ALL`
| http://docs.oracle.com/javase/{java-target-version}/docs/api/java/util/logging/Level.html#ALL[ALL]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#ALL[ALL]
|===
== Log4j JDK Logging Bridge Handler
Expand Down
Expand Up @@ -24,7 +24,7 @@ Spring Boot applications initialize logging 3 times.
. SpringApplication declares a Logger.
This Logger will be initialized using Log4j's "normal" mechanisms.
Thus a system property named log4j2.configurationFile will be checked to see if a specific configuration file has been provided, otherwise it will search for a configuration file on the classpath.
Thus the xref:manual/configuration.adoc#log4j2.configurationFile[`log4j2.configurationFile`] system property will be checked to see if a specific configuration file has been provided, otherwise it will search for a configuration file on the classpath.
The property may also be declare in log4j2.component.properties.
== Usage
Expand Down Expand Up @@ -122,67 +122,9 @@ logging:
Note that Log4j currently does not directly support encrypting the password.
However, Log4j does use Spring's standard APIs to access properties in the Spring configuration so any customizations made to Spring's property handling would apply to the properties Log4j uses as well.
If more extensive authentication is required an `AuthorizationProvider` can be implemented and the fully qualified class name in the `log4j2.authorizationProvider` system property, in log4j2.component.properties or in Spring's bootstrap.yml using either the `log4j2.authorizationProvider` key or with the key `logging.auth.authorizationProvider`.
If more extensive authentication is required an `AuthorizationProvider` can be implemented and its fully qualified class name should be specified in the xref:manual/configuration.adoc#log4j2.configurationAuthorizationProvider[log4j2.configurationAuthorizationProvider] system property, in log4j2.component.properties or in Spring's `bootstrap.yml` using either the `log4j2.authorizationProvider` or `logging.auth.authorizationProvider` key.
TLS can be enabled by adding the following system properties or defining them in log4j2.component.properties
|===
| Property | Optional or Default Value | Description
| log4j2.trustStoreLocation
| Optional
| The location of the trust store.
If not provided the default trust store will be used.
| log4j2.trustStorePassword
| Optional
| Password needed to access the trust store.
| log4j2.trustStorePasswordFile
| Optional
| The location of a file that contains the password for the trust store.
| log4j2.trustStorePasswordEnvironmentVariable
| Optional
| The name of the environment variable that contains the trust store password.
| log4j2.trustStoreKeyStoreType
| Required if keystore location provided
| The type of key store.
| log4j2.trustStoreKeyManagerFactoryAlgorithm
| Optional
| Java cryptographic algorithm.
| log4j2.keyStoreLocation
| Optional
| The location of the key store.
If not provided the default key store will be used.
| log4j2.keyStorePassword
| Optional
| Password needed to access the key store.
| log4j2.keyStorePasswordFile
| Optional
| The location of a file that contains the password for the key store.
| log4j2.keyStorePasswordEnvironmentVariable
| Optional
| The name of the environment variable that contains the key store password.
| log4j2.keyStoreType
| Required if trust store location provided.
| The type of key store.
| log4j2.keyStoreKeyManagerFactoryAlgorithm
| Optional
| Java cryptographic algorithm.
| log4j2.sslVerifyHostName
| false
| true or false
|===
For the properties required by TLS configuration see xref:manual/configuration.adoc#transport-security[the Transport Security configuration].
== Requirements
Expand Down

0 comments on commit 877ef02

Please sign in to comment.