[ 
https://issues.apache.org/jira/browse/WW-5620?focusedWorklogId=1031208&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031208
 ]

ASF GitHub Bot logged work on WW-5620:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jul/26 08:22
            Start Date: 20/Jul/26 08:22
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart opened a new pull request, #1794:
URL: https://github.com/apache/struts/pull/1794

   ## Summary
   
   Standardizes the remaining legacy logging in the codebase on Log4j2, the 
project's standard logging layer, and removes the now-dead first-party SLF4J 
dependency declarations. Pure refactor/cleanup — **no functional or security 
behavior changes**.
   
   Fixes [WW-5620](https://issues.apache.org/jira/browse/WW-5620).
   
   ## Changes
   
   - **`FinalizableReferenceQueue`** (core): migrated from `java.util.logging` 
to Log4j2 (`SEVERE` → `error`, message and throwable preserved).
   - **`AbstractDefaultToStringRenderable`** (tiles plugin): migrated from 
SLF4J to Log4j2 (call-compatible `log.error(msg, e)` unchanged).
   - **`ContainerBuilder`** (core): removed the unused injectable 
`java.util.logging.Logger` DI factory (a legacy Guice feature — nothing in the 
repo injects it) along with its now-unused `Member`/`Logger` imports and 
Javadoc bullet.
   - **poms** (`core`, `parent`, root): removed the dead first-party SLF4J 
dependency declarations (core's `slf4j-api` was `optional`, so it never 
propagated transitively). Runtime bridges (`log4j-slf4j-impl`, `log4j-jcl`) are 
intentionally left in place.
   
   All three migrated/edited source files are vendored (Google Guice / Apache 
Tiles), so there is no upstream-sync concern.
   
   ## Testing
   
   - `core`: `mvn test -DskipAssembly -pl core` — 2997 tests pass.
   - `plugins/tiles`: `mvn test -DskipAssembly -pl plugins/tiles` — 545 tests 
pass.
   - Verified no first-party source references `org.slf4j` or 
`java.util.logging` after the change; the only remaining `slf4j` in any pom is 
the intentional `apps/showcase` `log4j-slf4j-impl` runtime bridge.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1031208)
    Remaining Estimate: 0h
            Time Spent: 10m

> Replace java.util.logging and SLF4J with Log4j2
> -----------------------------------------------
>
>                 Key: WW-5620
>                 URL: https://issues.apache.org/jira/browse/WW-5620
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core, Plugin - Tiles
>            Reporter: Lukasz Lenart
>            Priority: Trivial
>             Fix For: 7.3.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Struts 7 standardizes on Log4j2 as its logging layer, but three files still 
> use legacy logging frameworks.
> h3. java.util.logging (JUL) — 2 files in core
> * {{core/src/main/java/org/apache/struts2/inject/ContainerBuilder.java}} — 
> JUL {{Logger}} used in {{LOGGER_FACTORY}} (injects loggers via the DI 
> container) and imported as a type
> * 
> {{core/src/main/java/org/apache/struts2/inject/util/FinalizableReferenceQueue.java}}
>  — JUL {{Logger}} + {{Level}} used for error logging
> h3. org.slf4j — 1 file in plugins/tiles
> * 
> {{plugins/tiles/src/main/java/org/apache/tiles/velocity/template/AbstractDefaultToStringRenderable.java}}
>  — SLF4J {{Logger}} + {{LoggerFactory}}
> h3. What needs to change
> * Replace {{java.util.logging.Logger}} / {{Level}} imports with 
> {{org.apache.logging.log4j.LogManager}} / {{Logger}}
> * Replace {{Logger.getLogger(name)}} with {{LogManager.getLogger(class)}}
> * Replace {{Logger.getAnonymousLogger()}} with {{LogManager.getRootLogger()}}
> * Replace {{logger.log(Level.SEVERE, msg, throwable)}} with 
> {{logger.error(msg, throwable)}}
> * Replace {{org.slf4j.LoggerFactory.getLogger()}} with 
> {{LogManager.getLogger()}}
> All three files contain code originally imported from external projects 
> (Google Guice and Apache Tiles). No other classes inject 
> {{java.util.logging.Logger}} from the container, so the migration is safe. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to