Ok, in that case this is the right post for you.
Lets take an ordinary (synchronous) file logger from Log4j 1.x ( tested with 1.2.17) and wrap it up with a 'cool' AsyncAppender. :D.
Considering that you have
import org.slf4j.Logger ... static Logger log = LoggerFactory.getLogger("MyLogger");
You turn your internal sync appender into an async with:
static { AsyncAppenderBuilder.wrapAsyncAppender(log, "MyAppndrName") }
Then use just like a regular logger
The helping class looks like this:
Hope it helps!
Iván.
No hay comentarios:
Publicar un comentario