I have been trying log4j2 recently. Now, I would like to test it with slf4j and wondering if all the functionality in log4j2 (e.g. async logging via disruptor) will be available if I try slf4j with log4j2. I have tried adding the slf4j jar files and log4j2 & disruptor jar files to a test project (I added the log4j-slf4j jar but not completely sure if its only meant for log4j or for log4j2 as well). When I use log4j2, I can log out statements to the log file. When I try slf4j, it does not work (and I'm not sure if its my config or the fact that slf4j is not setup to work with log4js disruptor logging? Any suggestions would be welcome. I will update the post with more info and sample code as well.
Yes, async loggers via the disruptor should work whether your app uses the log4j2 api, the slf4j api or the log4j-1.2 api. See the log4j2 FAQ page for which jars to include. You'll need a jar for the slf4j api, and in addition you'll need the log4j-api-2.x, log4j-core-2.x and log4j-slf4j-impl-2.x jars. The same log4j2.xml config file should work.
Update: not all Log4j2 functionality is available via the SLF4J API.