logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: migration from log4j 1.2 to log4j2: locationInformation and getAppender() are missing
Date Sat, 24 Jan 2015 05:29:32 GMT
What are you trying to do with the locationInfo?

Appenders are not directly attached to Loggers.  Every logger will be associated with a LoggerConfig.
The LoggerConfig may be associated with one or more Appenders.

It would be helpful to know a little more about what you are trying to do.  Log4j 2 is very
different than Log4j 1 and it may be that Log4j 2 already provides the means to achieve what
you are trying to do.


> On Jan 23, 2015, at 12:17 PM, Onion Crucian <onioncrucian@gmail.com> wrote:
> Hi,
> I am doing POC to migrate current project from using log4j1 to log4j2.
> There are custom appenders in our projects and we are using a lot of log4j
> internal APIs. There are a few things I couldn't find the new way to
> achieve. I appreciate if anyone can help.
> 1 LocationInfomation.
> we used to get locationinformation like this in case of no exception thrown
> from caller:
> locationInfo = new LocationInfo(new Throwable(),
> logEvent.getFQNOfLoggerClass());
> I couldn't find the log4j2 implenentation to do the similar thing.
> 2 how to getAppender from logger? we have a lot of code to get the appender
> in the project: logger.getAppender(appenderName). I read the api for the
> log4j2, I couldn't find any.
> Thank you all for your time.
> Wei

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message