Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Piotr P. Karwasz
Hi Pooja, On Sat, Mar 5, 2022 at 1:48 PM Pooja Pandey wrote: > Hi Piotr, > > I don’t understand what is the bug?? Can you please help me with JIRA > ticket summary and description. The bug is that if you use a native Log4j 1.2 appender (a derivative class of org.apache.log4j.FileAppender for

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Pooja Pandey
Hi Piotr, I don’t understand what is the bug?? Can you please help me with JIRA ticket summary and description. Thank you so much for your help. Get Outlook for iOS From: Piotr P. Karwasz Sent: Saturday, March 5, 2022 12:27:50 PM To:

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Pooja Pandey
Thank you so much Piotr for detailed explanation of bug. I will create JIRA ticket ASAP and shortly will reply with details also you have asked. Get Outlook for iOS From: Piotr P. Karwasz Sent: Saturday, March 5, 2022 7:23:34 PM To: Log4J

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Pooja Pandey
Hi Ralph, We needed custom logger long long back when log4j1 logger was not sufficient to achieve the goal we had. We have multiple processes also using this logger. For Appender, we actually needed rolling file appender, but the available appender in log4j1 didn’t work as expected with

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Piotr P. Karwasz
Ralph, On Sat, Mar 5, 2022 at 6:21 PM Ralph Goers wrote: > Even if getAppender() were to bypass the AppenderWrapper it would still return > org.apache.logging.log4j.core.appender.FileAppender, not > org.apache.log4j.FileAppender. > Are you proposing that getAppender return a proxy for >

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Ralph Goers
Piotr, Even if getAppender() were to bypass the AppenderWrapper it would still return org.apache.logging.log4j.core.appender.FileAppender, not org.apache.log4j.FileAppender. Are you proposing that getAppender return a proxy for org.apache.log4j.FileAppender? Ralph > On Mar 5, 2022, at 6:53

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Ralph Goers
So if I understand correctly, you wrote a custom RollingFileAppender that extends the FileAppender? If so, that should work just fine. But that would just be a matter of compiling it and then using your custom appender in the log4j.xml. What is the tie in that requires a custom Logger? Also,

Re: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Gary Gregory
This is a bit tricky, the API is typed to return an Appender and that's what we do, not only that but it is an Appender that behaves properly IIRC. If we returned the wrapped Log4j 1 Appender and you call it, the wrong thing will happen IIRC. Gary On Sat, Mar 5, 2022, 15:02 Piotr P. Karwasz

RE: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Pooja Pandey
I have created below JIRA ticket for the issue I am facing, LOG4J2-3426 Log4j 1.x bridge Logger.getAppender returns a wrapped AppenderAdapter Link -> https://issues.apache.org/jira/browse/LOG4J2-3426 Thanks, Pooja -Original Message- From: Pooja Pandey Sent: Sunday, March 6, 2022

RE: java.lang.ClassCastException: org.apache.log4j.bridge.AppenderWrapper cannot be cast to org.apache.log4j.FileAppender

2022-03-05 Thread Pooja Pandey
Hi Ralph, -> What is the tie in that requires a custom Logger? We have created customLogger to achieve some specific initialization for our application. Thanks, Pooja -Original Message- From: Ralph Goers Sent: Saturday, March 5, 2022 10:55 PM To: Log4J Users List Subject: Re: