Re: Migrating from log4j 1.2 to log4j 2

2014-01-31 Thread Ralph Goers
As it should be. They are very much subject to the internal workings of Log4j core and have nothing to do with the end user API. FWIW - here is the code you need. org.apache.log4j.coreLoggerContext ctx = (org.apache.log4j.core.LoggerContext) LogManager.getContext(false); Configuration config

Re: Migrating from log4j 1.2 to log4j 2

2014-01-31 Thread Ralph Goers
Gary, there are tons of unit tests that get the appenders. You have to get the Configuration from the loggerContext. That is where the Appenders are, not on the Loggers. Ralph On Jan 30, 2014, at 6:23 PM, Gary Gregory wrote: > I have finally created a separate sandbox for our app server to

Re: Migrating from log4j 1.2 to log4j 2

2014-01-31 Thread Gary Gregory
Another item of note is that Appender is in the Core, not the public API. Gary On Thu, Jan 30, 2014 at 9:54 PM, Remko Popma wrote: > Away from PC now, but if I remember correctly, that method is now commented > as "only used by Junit tests". That may be the most convenient method to > use. We

Migrating from log4j 1.2 to log4j 2

2014-01-30 Thread Remko Popma
Away from PC now, but if I remember correctly, that method is now commented as "only used by Junit tests". That may be the most convenient method to use. We may want to change that comment though... On Friday, January 31, 2014, Gary Gregory > wrote: > I have finally created a separate sandbox fo

Re: Migrating from log4j 1.2 to log4j 2

2014-01-30 Thread Gary Gregory
I have finally created a separate sandbox for our app server to test porting from log4j1 to 2. The first thing I run into? Just this issue! ;) We have code like this: Logger.getRootLogger().getAllAppenders() Why? Because the server looks for the log file (if any) so that it can return its tail

Re: Migrating from log4j 1.2 to log4j 2

2014-01-30 Thread Remko Popma
Hi Abhishek, These are currently private fields and not easily accessible. Can you explain your use case? Why do you need this? Best regards, Remko On Thu, Jan 30, 2014 at 2:33 PM, ~Abhi$hek~ wrote: > Hello Log4j 2 experts, > > > > I am in the process of migrating my application from log4j 1.

Migrating from log4j 1.2 to log4j 2

2014-01-29 Thread ~Abhi$hek~
Hello Log4j 2 experts, I am in the process of migrating my application from log4j 1.2 to log4j 2.0 I have existing code: Enumeration appenders = logger.getAllAppenders(); . . . fileBackupIndex = rollingFileAppender.getMaxBackupIndex(); maxFileSize = rollingFileAppender.getMaximumFileSize(