It turns out that I should also init a new AsyncLoggerContext.
And then it will work and use asyncLogger.

On Wed, Dec 9, 2015 at 10:30 PM, Strong Su <[email protected]> wrote:

> Hello everyone,
>
> I'm trying to use log4j2 programmatically. And I follow the instruction of
> Programmatically Modifying the Current Configuration after Initialization.
>
> http://logging.apache.org/log4j/2.x/manual/customconfig.html#AddingToCurrent
> That worked but it's using syncLogger.
> I think changing LoggerConfig.createLogger to
> AsyncLoggerConfig.createLogger may works but it didn't.
>
> So how can I using asyncLogger in log4j2 programmatically after
> initiallization?
> I'm using log4j2.3.
>
> Thank you very much.
>
> Best Regards,
> Dylan Su
>

Reply via email to