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

ASF GitHub Bot commented on HADOOP-18631:
-----------------------------------------

virajjasani commented on PR #5451:
URL: https://github.com/apache/hadoop/pull/5451#issuecomment-1455168482

   I also wrote test like this to verify that it doesn't print anything when 
run simultaneously with both TestFsck and TestAuditLogs:
   
   ```
     @Test
     public void t1() throws Exception {
       LogCapturer l = LogCapturer.captureLogs(FSNamesystem.AUDIT_LOG);
       Thread.sleep(5000);
       String str = l.getOutput();
       System.out.println(str);
       l.stopCapturing();
     }
   ```
   
   Hence, to this point, the above PR is sufficient IMO. However, I do see that 
other tests do need to cleanup the appender instances that they have used, 
which they are not doing as of today.
   
   As a separate follow-up Jira, I want to propose that we make LogCapturer as 
closeable and every test can either use try-with-resource or use close() 
directly and as part of the close, it should do appender cleanup so that it 
doesn't burden log4j with unnecessary appends. If you agree with this 
@ayushtkn, I will create sub-task.
   Thanks




> Migrate Async appenders to log4j properties
> -------------------------------------------
>
>                 Key: HADOOP-18631
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18631
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>
> Before we can upgrade to log4j2, we need to migrate async appenders that we 
> add "dynamically in the code" to the log4j.properties file. Instead of using 
> core/hdfs site configs, log4j properties or system properties should be used 
> to determine if the given logger should use async appender.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to