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

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

                Author: ASF GitHub Bot
            Created on: 20/Jul/26 11:41
            Start Date: 20/Jul/26 11:41
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart merged PR #1794:
URL: https://github.com/apache/struts/pull/1794




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

    Worklog Id:     (was: 1031247)
    Time Spent: 0.5h  (was: 20m)

> 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: 0.5h
>  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