Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add references to Copernik.eu Log4j components #3534

Merged
merged 3 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/site/antora/modules/ROOT/pages/manual/lookups.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,12 @@ include::partial$features/servlet-support.adoc[]
[#third-party]
== Third-party lookups

The following additional lookups are available from third-party vendors:
[IMPORTANT]
====
These lookups are provided by **third-party** vendors and are not maintained by the
link:{logging-services-url}[Apache Logging Services]
(Log4j, Log4cxx, Log4net) project.
====

[#KubernetesLookup]
=== Kubernetes Lookup
Expand Down Expand Up @@ -999,6 +1004,24 @@ The Spring Boot 3 Lookup conflicts with the <<#SpringBootLookup>>.
If you are upgrading to Spring Boot 3, make sure to remove the latter from your classpath.
====

[#TomcatLookup]
=== Tomcat Lookup

[cols="1h,4"]
|===
| Syntax
|
`tomcat:<key>`

where `key` is one of the
https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#TomcatLookup-keys[supported Tomcat Lookup keys]
| Dependency | https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#installation[`eu.copernik:log4j-tomcat`]
|===

The Tomcat Lookup allows retrieving the names of the currently active Tomcat engine, host and application context.
See
https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#TomcatLookup[Copernik.eu Tomcat Lookup documentation] for more details.

[#extending]
== Extending

Expand Down
17 changes: 16 additions & 1 deletion src/site/antora/modules/ROOT/pages/manual/thread-context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,22 @@ You can provide a custom `ContextDataProvider` implementation as follows:
----
META-INF/services/org.apache.logging.log4j.core.util.ContextDataProvider
----
. Write the fully-qualified class name of your custom implementation (e.g., `com.mycompany.CustomContextDataProvider`) to the file created in the previous step
. Write the fully-qualified class name of your custom implementation (e.g., `com.mycompany.CustomContextDataProvider`) to the file created in the previous step.

==== Third-party custom thread context data providers

[IMPORTANT]
====
These context data providers are supplied by **third-party** vendors and are not maintained by the
link:{logging-services-url}[Apache Logging Services]
(Log4j, Log4cxx, Log4net) project.
====

https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure[OpenTelemetry Context Data Provider]::
Injects trace context data into log events.

https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#TomcatContextDataProvider[Copernik.eu Tomcat Context Data Provider]::
Injects the name of the currently active Tomcat engine, host and web application into log events.

[#custom-ThreadContextMap]
=== Custom thread context map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,19 @@ link:../javadoc/log4j-core/org/apache/logging/log4j/core/osgi/BundleContextSelec
Creates a separate logger context per OSGi bundle and synchronous loggers

link:../javadoc/log4j-core/org/apache/logging/log4j/core/selector/JndiContextSelector.html[`org.apache.logging.log4j.core.selector.JndiContextSelector`]::
Creates loggers contexts based on a JNDI lookup and synchronous loggers See xref:jakarta.adoc#jndi-configuration[Web application] for details.
Creates loggers contexts based on a JNDI lookup and synchronous loggers See xref:jakarta.adoc#jndi-configuration[Web application] for details.

There are also third-party context selector implementations:

[IMPORTANT]
====
These context selectors are provided by **third-party** vendors and are not maintained by the
link:{logging-services-url}[Apache Logging Services]
(Log4j, Log4cxx, Log4net) project.
====

https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#TomcatContextSelector[`eu.copernik.log4j.tomcat.TomcatContextSelector`]::
Selects the currently active Tomcat web application and creates synchronous loggers.

https://oss.copernik.eu/tomcat/3.x/components/log4j-tomcat#TomcatContextSelector[`eu.copernik.log4j.tomcat.TomcatAsyncContextSelector`]::
Selects the currently active Tomcat web application and creates xref:manual/async.adoc[asynchronous loggers].