Hi Team,

        Currently our application is using Apache - Log4j 1.2.16 version . 
To mitigate the PISRT alert  (CVE-2019-17571), our application has to 
migrate Log4j from 1.2.16 version to 2.12.1 version. As a part of this 
migration activity we got stuck with  few doubts and we need 
clarifications for the same . Please find below the list of queries.


Queries List :

1)      Query related to AbstractAppender constructor :
        Previously our application used log4j 1.2.16 version and in which 
we are able to extend the class WriterAppender to create a custom 
appender. But in new log4j 2.12.1 version, the  same class has made final 
and so we are not able to extend the class in our application. Hence we 
tried to extend the class AbstractAppender. Below is the clarification 
required in     order to use constructor of that class.
        •       From our application, while calling the super class 
constructor (i.e.  AbstractAppender) Can the parameters “filter” and 
“properties” be passed as null??
        •       We use the setLayout method in the super class 
WriterAppender but the AbstractAppender class does not have this method. 
Is there any equivalent method for this functionality??
        •       We use the setWriter(Writer writer) method in the super 
class WriterAppender but the AbstractAppender class does not have this 
method. Is there any equivalent method          for this functionality??
        •       We use the closeWriter() method in the super class 
WriterAppender but the AbstractAppender class does not have this method. 
Is there any equivalent method for this                 functionality??


2)      Query related to configure() method in PropertyConfigurator class:
        In new log4j 2.12.1 core jar, PropertyConfigurator class got 
removed and our application is using configure () method of that class. 
        So can we use the LoggerContext class as per the suggestion 
mentioned in the link (
https://logging.apache.org/log4j/2.0/faq.html#reconfig_from_code )    ??
        If so how to use the original method configure (String 
configFilename)??



3)      Query related to configureAndWatch () method in 
PropertyConfigurator class:
        In new log4j 2.12.1 core jar, PropertyConfigurator class got 
removed and our application is using configureAndWatch () method of that 
class. What could be the alternative method     to be used in new log4j 
2.12.1 jar??



4)      Query related to converting log4j.properties file syntax to 
log4j2.properties file syntax:
        Is there any reference document for migration of properties files?



5)      org.apache.log4j. ConsoleAppender.activateOptions() in log4j 
1.2.17
        In new log4j 2.12.1 version, activateOptions() method got removed 
from ConsoleAppender and also in its parent class AppenderSkeleton an 
empty method is present. What is the    equivalent method to be used? 



6)      org.apache.logging.log4j.core.appender.FileAppender.setFile(String 
file) in log4j 1.2.17
        In new log4j 2.12.1 version, setFile(String file) method got 
removed from FileAppender and also not found in its parent class 
AbstractAppender. What is the equivalent method to be   used?



7) org.apache.logging.log4j.core.appender.FileAppender.activateOptions() 
in log4j 1.2.17
        In new log4j 2.12.1 version, activateOptions() method got removed 
from FileAppender and also not found in its parent class AbstractAppender. 
What is the equivalent method to be     used?



8)      
org.apache.logging.log4j.core.appender.FileAppender.setAppend(boolean 
flag) in log4j 1.2.17
        In new log4j 2.12.1 version, setAppend(boolean flag) method got 
removed from FileAppender and also not found in its parent class 
AbstractAppender. What is the equivalent        method to be used?



9)      org.apache.log4j.Category.getLoggerRepository() in log4j 1.2.17
        In new log4j org.apache.log4j.Category is present in 
log4j-1.2-api-2.12.1.jar, but getLoggerRepository() is not found. What is 
the equivalent method to be used?



10)     org.apache.log4j.or.ObjectRenderer in log4j 1.2.17
        ObjectRenderer interface is not found in latest log4j. What is the 
equivalent interface/class to be used?



Note : For the above posted queries , we were not able to find the answers 
/ clarifications from release notes , migration document or from any other 
source . So we are requesting you to provide the support for the queries 
posted .

 
        Please let us know if any of the queries mentioned are not clear.



Thanks
Anusha
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Reply via email to