You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2024/01/01 10:53:51 UTC

(struts-examples) branch fix/avoid-scanning-logger created (now 370fb66)

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/avoid-scanning-logger
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


      at 370fb66  Avoids scanning all the classes from all the packages

This branch includes the following new commits:

     new 370fb66  Avoids scanning all the classes from all the packages

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(struts-examples) 01/01: Avoids scanning all the classes from all the packages

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch fix/avoid-scanning-logger
in repository https://gitbox.apache.org/repos/asf/struts-examples.git

commit 370fb66ed23f602f73e9f716f17f002cbbc5a43b
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Mon Jan 1 11:53:37 2024 +0100

    Avoids scanning all the classes from all the packages
---
 annotations/src/main/resources/log4j2.xml   | 1 +
 annotations/src/main/webapp/WEB-INF/web.xml | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/annotations/src/main/resources/log4j2.xml b/annotations/src/main/resources/log4j2.xml
index 3b08ab1..f5bdb17 100644
--- a/annotations/src/main/resources/log4j2.xml
+++ b/annotations/src/main/resources/log4j2.xml
@@ -8,6 +8,7 @@
     <Loggers>
         <Logger name="com.opensymphony.xwork2" level="info"/>
         <Logger name="org.apache.struts2" level="info"/>
+        <Logger name="org.apache.struts2.convention" level="debug"/>
         <Logger name="example" level="debug"/>
         <Root level="info">
             <AppenderRef ref="STDOUT"/>
diff --git a/annotations/src/main/webapp/WEB-INF/web.xml b/annotations/src/main/webapp/WEB-INF/web.xml
index 6b49ec1..035cc56 100644
--- a/annotations/src/main/webapp/WEB-INF/web.xml
+++ b/annotations/src/main/webapp/WEB-INF/web.xml
@@ -11,6 +11,15 @@
             <param-name>struts.devMode</param-name>
             <param-value>true</param-value>
         </init-param>
+        <!-- Log4j is using *Action suffix as well, so narrow scanning just to a given package -->
+        <init-param>
+            <param-name>struts.convention.action.packages</param-name>
+            <param-value>example.actions</param-value>
+        </init-param>
+        <init-param>
+            <param-name>struts.convention.package.locators.disable</param-name>
+            <param-value>true</param-value>
+        </init-param>
     </filter>
 
     <filter-mapping>