You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/faq.adoc
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,12 @@ Refer to xref:manual/configuration.adoc[the Configuration page] for further deta
45
45
== How do I configure Log4j programmatically?
46
46
47
47
Starting with version `2.4`, Log4j provides xref:manual/customconfig.adoc[an API for programmatic configuration].
48
-
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.
48
+
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.
49
49
50
50
[#reconfig_from_code]
51
51
== How do I reconfigure Log4j programmatically?
52
52
53
-
You can reconfigure Log4j programmatically using link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[the `Configurator` API] as follows:
53
+
You can reconfigure Log4j programmatically using link:javadoc/log4j-core/org/apache/logging/log4j/core/config/Configurator.html[the `Configurator` API] as follows:
54
54
55
55
[source,java]
56
56
----
@@ -67,12 +67,12 @@ Normally there is no need to do this manually.
67
67
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`.
68
68
Likewise, xref:jakarta.adoc[Web applications] replace the shutdown hook with their own resource management mechanisms.
69
69
That is, they clean up necessary resources when the web application is stopped.
70
-
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`].
70
+
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`].
71
71
72
72
[#reconfig_level_from_code]
73
73
== How do I set a logger level programmatically?
74
74
75
-
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:
75
+
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:
The utility of this method call depends upon the logging backend used with Log4j API.
206
206
207
207
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.
208
208
Starting in Log4j 2.1, you can also specify a custom
0 commit comments