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: getAppender
Date Wed, 19 Feb 2020 15:31:53 GMT
LoggerContext context = LogManager.getContext(“false”);
FileAppender appender = context.getConfiguration().getAppender("info");

Ralph


> On Feb 19, 2020, at 7:47 AM, EDMONDO SENA <edsen68@gmail.com> wrote:
> 
> Ok, but they are the API not examples....
> 
> 
> 
> 
> On 2020/02/19 14:29:41, Gary Gregory <garydgregory@gmail.com> wrote: 
>> Please see
>> https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Configuration.html#getAppender-java.lang.String-
>> 
>> On Wed, Feb 19, 2020, 09:27 EDMONDO SENA <edsen68@gmail.com> wrote:
>> 
>>> 
>>> Can you tell me where can I find out these examples?
>>> 
>>> Kind regards.
>>> //Edmondo.
>>> 
>>> 
>>> On 2020/02/19 14:09:52, Matt Sicker <boards@gmail.com> wrote:
>>>> Appenders and such are part of the core library now. There are likely
>>>> features in log4j2 that could replace what you’re doing, though. In any
>>>> case, there’s plenty of examples of how that is done in the tests.
>>>> 
>>>> On Wed, Feb 19, 2020 at 04:23 EDMONDO SENA <edsen68@gmail.com> wrote:
>>>> 
>>>>> 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.
>>>>> 
>>>>> How can I fix it?
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>>> 
>>>>> --
>>>> Matt Sicker <boards@gmail.com>
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> 
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message