You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2022/04/08 08:00:00 UTC

[jira] [Commented] (HADOOP-16206) Migrate from Log4j1 to Log4j2

    [ https://issues.apache.org/jira/browse/HADOOP-16206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17519391#comment-17519391 ] 

Duo Zhang commented on HADOOP-16206:
------------------------------------

I've already modified more than 1k lines of code(do not include the log4j.properties change), but maybe only half done. So finally I can provide a patch but I do not think it is easy to review or test.

The related code must be changed are:

1. Dynamically changing appenders(add a async appender in front of all the current appenders usually) and log levels.
2. Adding an appender in UTs to capture the log output.
3. Customized appenders, like Log4Json(is it still used?) or Log4jWarningErrorMetricsAppender.
4. In hadoop-kms we will programmingly load the log4j.properties(is it really necessary?)

And we still references commons-logging at many places, which should also be purged.

I prefer we first discuss and fix the above problems one by one, before finally moving to log4j2, to make the final move a bit easier. For example, I really doubt the value of modifying appenders at runtime, especially adding async appender. This should be done in log4j.properties, and you can also use the -Dhadoop.root.logger=INFO,AsyncAppender to control the appender to use when starting. And for changing log levels and capture log output in UTs, I think we could introduce a hadoop-logging module, provide some logging framework free interfaces to support these operations, so all other modules can just reference these interfaces to avoid depending on the real logging framework directly, then when moving to log4j2, we just need to modify one place, instead of modifying a bunch of classes.

If no big concerns, I will file new sub tasks to land the above proposals first.

Thanks.

> Migrate from Log4j1 to Log4j2
> -----------------------------
>
>                 Key: HADOOP-16206
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16206
>             Project: Hadoop Common
>          Issue Type: Sub-task
>    Affects Versions: 3.3.0
>            Reporter: Akira Ajisaka
>            Assignee: Duo Zhang
>            Priority: Major
>         Attachments: HADOOP-16206-wip.001.patch
>
>
> This sub-task is to remove log4j1 dependency and add log4j2 dependency.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org