This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push:
new df8e72f83c Add ProGuard rules to the FAQ (#2182)
df8e72f83c is described below
commit df8e72f83c7f066e9e27f8000acd56347125ecda
Author: Zongle Wang <[email protected]>
AuthorDate: Fri Jan 12 17:19:23 2024 +0800
Add ProGuard rules to the FAQ (#2182)
---
src/site/markdown/faq.md.vm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/site/markdown/faq.md.vm b/src/site/markdown/faq.md.vm
index 4aad757af9..07e7c955d0 100644
--- a/src/site/markdown/faq.md.vm
+++ b/src/site/markdown/faq.md.vm
@@ -37,6 +37,7 @@ $h1 Frequently Asked Questions
* [Is Log4j 2 still garbage-free when I use the SLF4J API?](#gc-free-slf4j)
* [How do I log my domain object without creating
garbage?](#gc-free-domain-object)
* [How do I create a custom logger wrapper that shows the correct class,
method and line number?](#logger-wrapper)
+* [Which rules do I need to add when minification is enabled?](#proguard-rules)
<a name="missing_core"/>
@@ -494,3 +495,12 @@ This tool was originally meant to support custom log
levels and is documented
[here](https://logging.apache.org/log4j/2.x/manual/customloglevels.html#CustomLoggers).
The generated logger code will take care of the FQCN.
+
+<a name="proguard-rules" />
+
+$h4 Which rules do I need to add when ProGuard minification is enabled?
+
+When you are using Log4j with ProGuard/R8 enabled, you need to add the
following rules to your configuration file:
+```
+-keep,allowoptimization class org.apache.logging.log4j.** { *; }
+```