Skip to content

Commit

Permalink
Broken relative links after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Jul 18, 2024
1 parent 2164611 commit d5ab2f2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions src/site/antora/modules/ROOT/pages/faq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Refer to xref:manual/configuration.adoc[the Configuration page] for further deta
== How do I configure Log4j programmatically?
Starting with version `2.4`, Log4j provides xref:manual/customconfig.adoc[an API for programmatic configuration].
link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.html[The new `ConfigurationBuilder` API] allows you to create ``Configuration``s in code by constructing component definitions without requiring you to know about the internals of actual configuration objects like loggers and appenders.
link:javadoc/log4j-core/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.html[The new `ConfigurationBuilder` API] allows you to create ``Configuration``s in code by constructing component definitions without requiring you to know about the internals of actual configuration objects like loggers and appenders.
[#reconfig_from_code]
== How do I reconfigure Log4j programmatically?
You can reconfigure Log4j programmatically using link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[the `Configurator` API] as follows:
You can reconfigure Log4j programmatically using link:javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[the `Configurator` API] as follows:
[source,java]
----
Expand All @@ -67,12 +67,12 @@ Normally there is no need to do this manually.
Each `LoggerContext` registers a shutdown hook that takes care of releasing resources when the JVM exits, unless the `log4j.shutdownHookEnabled` system property is set to `false`.
Likewise, xref:jakarta.adoc[Web applications] replace the shutdown hook with their own resource management mechanisms.
That is, they clean up necessary resources when the web application is stopped.
However, if you need to manually shut down Log4j, you can use one of the `shutdown()` methods of link:../javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#shutdown()[`LogManager`].
However, if you need to manually shut down Log4j, you can use one of the `shutdown()` methods of link:javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#shutdown()[`LogManager`].
[#reconfig_level_from_code]
== How do I set a logger level programmatically?
You can set the level of a logger using link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[`Configurator`] from Log4j Core:
You can set the level of a logger using link:javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[`Configurator`] from Log4j Core:
[source,java]
----
Expand Down
16 changes: 8 additions & 8 deletions src/site/antora/modules/ROOT/pages/jakarta.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Most notably:
- the usage of `ThreadLocal` for object pooling is disabled.
- a web-safe implementation of
link:../javadoc/log4j-api/org/apache/logging/log4j/spi/ThreadContextMap.html[`ThreadContextMap`] is used.
link:javadoc/log4j-api/org/apache/logging/log4j/spi/ThreadContextMap.html[`ThreadContextMap`] is used.
- JMX notifications are sent synchronously.
- the JVM shutdown hook is disabled.
Expand Down Expand Up @@ -245,7 +245,7 @@ https://jakarta.ee/specifications/servlet/5.0/apidocs/jakarta/servlet/asyncconte
method.
To successfully propagate the logger context along asynchronous calls, the
link:../javadoc/log4j-jakarta-web/org/apache/logging/log4j/web/WebLoggerContextUtils.html[`WebLoggerContextUtils`]
link:javadoc/log4j-jakarta-web/org/apache/logging/log4j/web/WebLoggerContextUtils.html[`WebLoggerContextUtils`]
helper class is made available.
Using this class you can either decorate a `Runnable` with method calls that bind the appropriate logger context to the thread:
Expand All @@ -256,7 +256,7 @@ include::example$manual/webapp/AsyncServlet.java[tag=automatic]
----
or, if more flexibility is required, you can apply the same logic by using
link:../javadoc/log4j-jakarta-web/org/apache/logging/log4j/web/Log4jWebSupport.html[`Log4jWebSupport`]:
link:javadoc/log4j-jakarta-web/org/apache/logging/log4j/web/Log4jWebSupport.html[`Log4jWebSupport`]:
.Snippet from an example {antora-examples-url}/manual/webapp/AsyncServlet.java[`AsyncServlet.java`]
[source,java,indent=0]
Expand Down Expand Up @@ -289,7 +289,7 @@ and no version compatible with Jakarta Server Pages 3.0 is available.
====
The Log4j Taglib library defines a tag for most
link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`]
link:javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`]
methods, including:
* simple and parameterized log statements:
Expand Down Expand Up @@ -440,7 +440,7 @@ See the https://docs.gradle.org/current/userguide/war_plugin.html#sec:war_depend
When using a shared instance of Log4j Core,
you might be interested in identifying the application associated with a given log event.
Log4j Core provides a mechanism to split all
link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`]
link:javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`]
instances into logging domains called
xref:manual/architecture.adoc#LoggerContext[`LoggerContext`]s.
You have therefore two ways to separate log events:
Expand Down Expand Up @@ -482,10 +482,10 @@ xref:manual/systemproperties.adoc#log4j2.contextSelector[`log4j2.contextSelector
system property to:
* either
link:../javadoc/log4j-core/org/apache/logging/log4j/core/selector/BasicContextSelector.html[`org.apache.logging.log4j.core.selector.BasicContextSelector`]
link:javadoc/log4j-core/org/apache/logging/log4j/core/selector/BasicContextSelector.html[`org.apache.logging.log4j.core.selector.BasicContextSelector`]
to use synchronous loggers,
* or
link:../javadoc/log4j-core/org/apache/logging/log4j/core/async/BasicAsyncLoggerContextSelector.html[`org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector`]
link:javadoc/log4j-core/org/apache/logging/log4j/core/async/BasicAsyncLoggerContextSelector.html[`org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector`]
to use asynchronous loggers.
In this approach, you must use xref:manual/lookups.adoc[lookups] to register the application that generated a log event.
Expand Down Expand Up @@ -580,7 +580,7 @@ include::example$manual/webapp/log4j2-single.properties[tag=routing]
==== Multiple logger contexts
Since Log4j Core uses
link:../javadoc/log4j-core/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.html[`ClassLoaderContextSelector`]
link:javadoc/log4j-core/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.html[`ClassLoaderContextSelector`]
by default, no configuration is needed to achieve multiple logger contexts in your application server:
the classes of each classloader will use the logger context associated with the classloader.
Expand Down
16 changes: 8 additions & 8 deletions src/site/antora/modules/ROOT/pages/manual/customloglevels.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ Log4j contains following predefined levels:
|===
| Name | Priority
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#OFF[`OFF`]<<dont-use-in-code,[see note]>>
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#OFF[`OFF`]<<dont-use-in-code,[see note]>>
| 0
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#FATAL[`FATAL`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#FATAL[`FATAL`]
| 100
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#ERROR[`ERROR`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#ERROR[`ERROR`]
| 200
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#WARN[`WARN`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#WARN[`WARN`]
| 300
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#INFO[`INFO`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#INFO[`INFO`]
| 400
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#DEBUG[`DEBUG`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#DEBUG[`DEBUG`]
| 500
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#TRACE[`TRACE`]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#TRACE[`TRACE`]
| 600
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level#ALL[`ALL`]<<dont-use-in-code,[see note]>>
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html#ALL[`ALL`]<<dont-use-in-code,[see note]>>
| Integer.MAX_VALUE
|===
Expand Down
26 changes: 13 additions & 13 deletions src/site/antora/modules/ROOT/pages/migrate-from-log4j1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,25 @@ In order to migrate you code, you need to:
| Migrate Log4j 1 type | to Log4j type
| {log4j1-url}/apidocs/org/apache/log4j/MDC.html[org.apache.log4j.MDC]
| link:../javadoc/log4j-api/org/apache/logging/log4j/ThreadContext.html[org.apache.logging.log4j.ThreadContext]
| link:javadoc/log4j-api/org/apache/logging/log4j/ThreadContext.html[org.apache.logging.log4j.ThreadContext]
| {log4j1-url}/apidocs/org/apache/log4j/NDC.html[org.apache.log4j.NDC]
| link:../javadoc/log4j-api/org/apache/logging/log4j/ThreadContext.html[org.apache.logging.log4j.ThreadContext]
| link:javadoc/log4j-api/org/apache/logging/log4j/ThreadContext.html[org.apache.logging.log4j.ThreadContext]
| {log4j1-url}/apidocs/org/apache/log4j/Priority.html[org.apache.log4j.Priority]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html[org.apache.logging.log4j.Level]
| link:javadoc/log4j-api/org/apache/logging/log4j/Level.html[org.apache.logging.log4j.Level]
| {log4j1-url}/apidocs/org/apache/log4j/Level.html[org.apache.log4j.Level]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html[org.apache.logging.log4j.Level]
| link:javadoc/log4j-api/org/apache/logging/log4j/Level.html[org.apache.logging.log4j.Level]
| {log4j1-url}/apidocs/org/apache/log4j/Category.html[org.apache.log4j.Category]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html[org.apache.logging.log4j.Logger]
| link:javadoc/log4j-api/org/apache/logging/log4j/Logger.html[org.apache.logging.log4j.Logger]
| {log4j1-url}/apidocs/org/apache/log4j/Logger.html[org.apache.log4j.Logger]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html[org.apache.logging.log4j.Logger]
| link:javadoc/log4j-api/org/apache/logging/log4j/Logger.html[org.apache.logging.log4j.Logger]
| {log4j1-url}/apidocs/org/apache/log4j/LogManager.html[org.apache.log4j.LogManager]
| link:../javadoc/log4j-api/org/apache/logging/log4j/LogManager.html[org.apache.logging.log4j.LogManager]
| link:javadoc/log4j-api/org/apache/logging/log4j/LogManager.html[org.apache.logging.log4j.LogManager]
|===
* Some Log4j 1 methods were renamed or moved to a different class.
Expand All @@ -178,13 +178,13 @@ Therefore, you need to replace the following methods with their Log4j 2 API equi
| Migrate Log4j 1 method | to Log4j method
| {log4j1-url}/apidocs/org/apache/log4j/Logger.html#getLogger(java.lang.String)[Logger.getLogger()]
| link:../javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#getLogger()[LogManager.getLogger()]
| link:javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#getLogger()[LogManager.getLogger()]
| {log4j1-url}/apidocs/org/apache/log4j/Logger.html#getRootLogger()[Logger.getRootLogger()]
| link:../javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#getRootLogger()[LogManager.getRootLogger()]
| link:javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#getRootLogger()[LogManager.getRootLogger()]
| {log4j1-url}/apidocs/org/apache/log4j/Category.html#getEffectiveLevel()[Category.getEffectiveLevel()]
| link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html#getLevel()[Logger.getLevel()]
| link:javadoc/log4j-api/org/apache/logging/log4j/Logger.html#getLevel()[Logger.getLevel()]
|===
* Finally, some methods need specific conversion rules to be applied:
Expand All @@ -199,14 +199,14 @@ Therefore, you need to replace the following methods with their Log4j 2 API equi
| {log4j1-url}/apidocs/org/apache/log4j/LogManager.html#shutdown()[`LogManager.shutdown()`]
| Since Log4j 2.6, an equivalent
link:../javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#shutdown()[`o.a.l.l.LogManager.shutdown()`]
link:javadoc/log4j-api/org/apache/logging/log4j/LogManager.html#shutdown()[`o.a.l.l.LogManager.shutdown()`]
method can be used.
The utility of this method call depends upon the logging backend used with Log4j API.
The Log4j Core backend automatically adds a JVM shutdown hook on start up to perform any cleanups, so the `LogManager.shutdown()` call can be safely removed.
Starting in Log4j 2.1, you can also specify a custom
link:../javadoc/log4j-core/org/apache/logging/log4j/core/util/ShutdownCallbackRegistry.html[ShutdownCallbackRegistry].
link:javadoc/log4j-core/org/apache/logging/log4j/core/util/ShutdownCallbackRegistry.html[ShutdownCallbackRegistry].
See
xref:manual/systemproperties.adoc#log4j2.shutdownCallbackRegistry[log4j2.shutdownCallbackRegistry]
Expand Down Expand Up @@ -504,7 +504,7 @@ The support for Log4j 1 configuration files uses Log4j 2 Core plugin system and
The Log4j 1 to Log4j 2 bridge supports out-of-the-box the following
{log4j1-url}/index.html[Log4j 1]
and
link:/log4j/extras/index/html[Apache Extras for Log4j 1]
link:/log4j/extras/index.html[Apache Extras for Log4j 1]
components:
Appenders::
Expand Down

0 comments on commit d5ab2f2

Please sign in to comment.