On 7/10/2015 3:34 AM, Oliver Schrenk wrote: > I see (1) that Solr 5 uses log4j1.2 for logging. As we have some bad > experiences especially with the syslog implementation supplied by log4j we > wanted to use log4j2 . Does anybody have experiences with using the log4j > bridge (2)? Is it possible to switch?
Solr actually uses slf4j, with the API jar included in the .war file and all other logging jars placed in Jetty's lib/ext directory. The final combined configuration binds log4j1.2 as the logging destination. I asked on the log4j mailing list once about how I could use log4j2 as the final destination, since nothing is included from the slf4j that works with log4j2. It's been a while since I got the response, but it turns out that the log4j2 distribution actually includes jars that implement the slf4j API. I believe that if you replace some (or maybe all) of the slf4j jars we are currently shipping in server/lib/ext with appropriate jars from the log4j2 project, you should be able to get logging to work. I expect it would break the logging tab in the admin UI, because there is no code in Solr that knows how to tap into log4j2. This entire premise is untested. Thanks, Shawn