How to configure rollbar-java to work with Log4j2


Curious about Log4J (“Log4Shell”) impact on Rollbar-Java

Learn more in our community update





  1. Configure Rollbar in your log4j2.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
    <Rollbar name="ROLLBAR">

    <Root level="debug">
      <AppenderRef ref="ROLLBAR" />
  1. Create a Rollbar logger in your code and log an exception.
Logger logger = LoggerFactory.getLogger("com.example.rollbar.logback");

Known Issues

Building fat-jar

Due to the issue LOG4J2-954, with log4j2, when building a fat-jar, it seems that some .dat files are not concatenated.

Possible solutions would be to use this gradle plugin https://github.com/TheBoegl/shadow-log4j-transformer or the maven equivalent one https://github.com/edwgiz/maven-shaded-log4j-transformer.

Thanks to Steve for reporting and sending the solution to us, you can find more info about this issue here.

For further examples and information on using rollbar-log4j2, check out the example app here.


For more information on rollbar-java, please see the docs here.