├── examples ├── rollbar-android │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── dimens.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── menu │ │ │ │ │ └── menu_main.xml │ │ │ │ └── layout │ │ │ │ │ ├── content_main.xml │ │ │ │ │ └── activity_main.xml │ │ │ └── AndroidManifest.xml │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── rollbar │ │ │ │ └── example │ │ │ │ └── android │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── example │ │ │ └── android │ │ │ └── ExampleInstrumentedTest.java │ ├── proguard-rules.pro │ └── build.gradle ├── rollbar-spring-boot3-webmvc │ ├── gradle.properties │ ├── settings.gradle │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── springbootwebmvc │ │ │ ├── ExampleApplication.java │ │ │ ├── RollbarConfig.java │ │ │ └── ExampleViewController.java │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── build.gradle ├── rollbar-spring-boot-webmvc │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── springbootwebmvc │ │ │ ├── ExampleApplication.java │ │ │ ├── RollbarConfig.java │ │ │ └── ExampleViewController.java │ └── build.gradle ├── rollbar-logback │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── rollbar │ │ │ └── logback │ │ │ └── example │ │ │ └── Greeting.java │ │ └── resources │ │ └── logback.xml ├── rollbar-log4j2 │ ├── build.gradle │ └── src │ │ └── main │ │ ├── resources │ │ └── log4j2.xml │ │ └── java │ │ └── com │ │ └── rollbar │ │ └── log4j2 │ │ └── example │ │ └── Greeting.java ├── rollbar-struts2 │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ ├── jsp │ │ │ │ └── index.jsp │ │ │ │ └── web.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── rollbar │ │ │ │ └── struts2 │ │ │ │ └── action │ │ │ │ └── HelloRollbarAction.java │ │ │ └── resources │ │ │ └── struts.xml │ └── build.gradle ├── rollbar-struts2-spring │ ├── src │ │ └── main │ │ │ ├── webapp │ │ │ └── WEB-INF │ │ │ │ ├── jsp │ │ │ │ └── index.jsp │ │ │ │ └── web.xml │ │ │ ├── resources │ │ │ ├── applicationContext.xml │ │ │ └── struts.xml │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── rollbar │ │ │ └── struts2 │ │ │ └── action │ │ │ └── HelloRollbarAction.java │ └── build.gradle ├── rollbar-web │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── rollbar │ │ │ │ └── web │ │ │ │ └── example │ │ │ │ ├── server │ │ │ │ └── ServerProvider.java │ │ │ │ ├── config │ │ │ │ └── MyConfigProvider.java │ │ │ │ └── servlet │ │ │ │ └── HelloRollbarServlet.java │ │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── web.xml │ └── build.gradle ├── rollbar-java │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── example │ │ │ └── Greeting.java │ └── build.gradle ├── rollbar-reactive-streams-reactor │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── log4j.properties │ └── build.gradle ├── rollbar-scala │ ├── build.gradle │ └── src │ │ └── main │ │ └── scala │ │ └── com │ │ └── rollbar │ │ └── example │ │ └── Application.scala └── rollbar-spring-webmvc │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── example │ └── springwebmvc │ ├── initializer │ └── AppInitializer.java │ ├── config │ └── RollbarConfig.java │ └── controller │ └── IndexController.java ├── rollbar-api ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── rollbar │ │ └── api │ │ ├── truncation │ │ └── StringTruncatable.java │ │ ├── json │ │ └── JsonSerializable.java │ │ ├── payload │ │ └── data │ │ │ ├── body │ │ │ ├── BodyContent.java │ │ │ └── Group.java │ │ │ ├── TelemetryType.java │ │ │ ├── Source.java │ │ │ └── Level.java │ │ └── annotations │ │ └── Unstable.java │ └── test │ └── java │ └── com │ └── rollbar │ └── api │ └── payload │ ├── data │ ├── body │ │ ├── TraceChainTest.java │ │ ├── TraceTest.java │ │ ├── CrashReportTest.java │ │ ├── CodeContextTest.java │ │ ├── ExceptionInfoTest.java │ │ ├── MessageTest.java │ │ └── FrameTest.java │ ├── ClientTest.java │ ├── NotifierTest.java │ ├── LevelTest.java │ └── PersonTest.java │ └── PayloadTest.java ├── native-agent ├── clippy.toml ├── include │ └── jvmti_wrapper.h ├── src │ ├── jvmti.rs │ └── errors.rs ├── Cargo.toml └── build.rs ├── rollbar-java └── src │ ├── test │ ├── resources │ │ ├── mockito-extensions │ │ │ └── org.mockito.plugins.MockMaker │ │ └── invalid.payload │ └── java │ │ └── com │ │ └── rollbar │ │ └── notifier │ │ ├── PayloadTestHelper.java │ │ ├── provider │ │ └── notifier │ │ │ ├── VersionHelperTest.java │ │ │ └── NotifierProviderTest.java │ │ ├── sender │ │ └── json │ │ │ └── JsonTestHelper.java │ │ ├── uncaughtexception │ │ └── RollbarUncaughtExceptionHandlerTest.java │ │ ├── truncation │ │ ├── TestString.java │ │ └── StringsStrategyTest.java │ │ └── transformer │ │ └── TransformerPipelineTest.java │ ├── main │ └── java │ │ └── com │ │ └── rollbar │ │ ├── notifier │ │ ├── config │ │ │ ├── ConfigProvider.java │ │ │ ├── Config.java │ │ │ ├── DefaultLevels.java │ │ │ └── ConfigProviderHelper.java │ │ ├── provider │ │ │ ├── timestamp │ │ │ │ └── TimestampProvider.java │ │ │ ├── Provider.java │ │ │ ├── server │ │ │ │ └── ServerProvider.java │ │ │ └── notifier │ │ │ │ ├── NotifierProvider.java │ │ │ │ └── VersionHelper.java │ │ ├── uuid │ │ │ └── UuidGenerator.java │ │ ├── sender │ │ │ ├── exception │ │ │ │ ├── SenderException.java │ │ │ │ └── ApiException.java │ │ │ ├── json │ │ │ │ └── JsonSerializer.java │ │ │ ├── listener │ │ │ │ ├── SenderListener.java │ │ │ │ └── SenderListenerCollection.java │ │ │ ├── Sender.java │ │ │ └── SenderFailureStrategy.java │ │ ├── fingerprint │ │ │ └── FingerprintGenerator.java │ │ ├── transformer │ │ │ ├── Transformer.java │ │ │ └── TransformerPipeline.java │ │ ├── truncation │ │ │ ├── StringsStrategy.java │ │ │ ├── TruncationStrategy.java │ │ │ └── TelemetryEventsStrategy.java │ │ ├── filter │ │ │ ├── Filter.java │ │ │ └── FilterPipeline.java │ │ ├── uncaughtexception │ │ │ └── RollbarUncaughtExceptionHandler.java │ │ ├── util │ │ │ └── ObjectsUtils.java │ │ └── wrapper │ │ │ └── ThrowableWrapper.java │ │ └── jvmti │ │ ├── LocalVariable.java │ │ └── CacheFrame.java │ └── integTest │ └── java │ └── com │ └── rollbar │ └── notifier │ └── util │ ├── ConstantTimeProvider.java │ ├── json │ ├── LevelSerializer.java │ ├── PayloadSerializer.java │ ├── BodySerializer.java │ └── DataSerializer.java │ └── RollbarResponse.java ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── compatibility.gradle ├── rollbarlibs.versions.toml └── quality.gradle ├── .github ├── dependabot.yml ├── scripts │ ├── fetch_to_tag.sh │ └── release.sh └── pull_request_template.md ├── rollbar-android ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── rollbar │ │ │ │ └── android │ │ │ │ ├── anr │ │ │ │ ├── AnrDetector.java │ │ │ │ ├── AnrListener.java │ │ │ │ ├── watchdog │ │ │ │ │ ├── LooperHandler.java │ │ │ │ │ └── WatchdogConfiguration.java │ │ │ │ ├── AnrException.java │ │ │ │ ├── historical │ │ │ │ │ └── stacktrace │ │ │ │ │ │ ├── StackTrace.java │ │ │ │ │ │ └── StackFrame.java │ │ │ │ ├── AnrConfiguration.java │ │ │ │ └── AnrDetectorFactory.java │ │ │ │ ├── util │ │ │ │ └── Constants.java │ │ │ │ ├── provider │ │ │ │ ├── PersonProvider.java │ │ │ │ └── NotifierProvider.java │ │ │ │ └── AndroidConfiguration.java │ │ └── AndroidManifest.xml │ └── test │ │ └── java │ │ └── com │ │ └── rollbar │ │ └── android │ │ ├── anr │ │ └── AnrDetectorFactoryTest.java │ │ └── provider │ │ └── NotifierProviderTest.java ├── build.gradle.kts └── proguard-rules.pro ├── rollbar-struts2 ├── build.gradle └── src │ └── test │ └── java │ └── com │ └── rollbar │ └── struts │ └── RollbarFactoryTest.java ├── rollbar-reactive-streams ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── reactivestreams │ │ │ └── notifier │ │ │ ├── sender │ │ │ ├── http │ │ │ │ ├── HttpClientFactory.java │ │ │ │ ├── AsyncHttpResponse.java │ │ │ │ ├── ApacheAsyncHttpClientFactory.java │ │ │ │ ├── AsyncHttpRequest.java │ │ │ │ ├── AsyncHttpRequestImpl.java │ │ │ │ └── AsyncHttpClient.java │ │ │ └── Sender.java │ │ │ └── config │ │ │ └── Config.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── reactivestreams │ │ │ └── notifier │ │ │ └── sender │ │ │ └── http │ │ │ └── AsyncHttpClientFactoryTest.java │ └── integTest │ │ └── java │ │ └── com │ │ └── rollbar │ │ └── reactivestreams │ │ └── notifier │ │ └── SyncSenderWrapperITest.java └── build.gradle.kts ├── rollbar-log4j2 ├── build.gradle └── README.md ├── rollbar-logback └── build.gradle ├── rollbar-web ├── build.gradle └── src │ ├── test │ └── java │ │ └── com │ │ └── rollbar │ │ └── web │ │ ├── config │ │ └── FakeConfigProvider.java │ │ ├── listener │ │ └── RollbarRequestListenerTest.java │ │ └── provider │ │ └── PersonProviderTest.java │ └── main │ └── java │ └── com │ └── rollbar │ └── web │ ├── provider │ └── PersonProvider.java │ └── listener │ └── RollbarRequestListener.java ├── rollbar-reactive-streams-reactor ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── reactivestreams │ │ │ ├── interleave │ │ │ └── VMLensTest.java │ │ │ └── notifier │ │ │ └── sender │ │ │ └── http │ │ │ └── AsyncHttpClientFactoryTest.java │ └── main │ │ └── java │ │ └── com │ │ └── rollbar │ │ └── reactivestreams │ │ └── notifier │ │ ├── sender │ │ └── http │ │ │ └── ReactorAsyncHttpClientFactory.java │ │ └── ReactorRollbar.java └── README.md ├── rollbar-spring-webmvc ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── rollbar │ │ └── spring │ │ └── webmvc │ │ ├── RollbarWebApplicationInitializer.java │ │ ├── RollbarSpringConfigBuilder.java │ │ └── RollbarHandlerExceptionResolver.java │ └── test │ └── java │ └── com │ └── rollbar │ └── spring │ └── webmvc │ └── RollbarHandlerExceptionResolverTest.java ├── rollbar-spring-boot-webmvc ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── rollbar │ └── spring │ └── boot │ └── webmvc │ └── RollbarServletContextInitializer.java ├── rollbar-jakarta-web ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── rollbar │ │ │ └── web │ │ │ ├── config │ │ │ └── FakeConfigProvider.java │ │ │ ├── listener │ │ │ └── RollbarRequestListenerTest.java │ │ │ └── provider │ │ │ └── PersonProviderTest.java │ └── main │ │ └── java │ │ └── com │ │ └── rollbar │ │ └── web │ │ ├── provider │ │ └── PersonProvider.java │ │ └── listener │ │ └── RollbarRequestListener.java └── build.gradle ├── rollbar-spring6-webmvc ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── rollbar │ │ └── spring │ │ └── webmvc │ │ ├── RollbarWebApplicationInitializer.java │ │ ├── RollbarSpringConfigBuilder.java │ │ └── RollbarHandlerExceptionResolver.java │ └── test │ └── java │ └── com │ └── rollbar │ └── spring │ └── webmvc │ └── RollbarHandlerExceptionResolverTest.java ├── rollbar-spring-boot3-webmvc ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── rollbar │ └── spring │ └── boot │ └── webmvc │ └── RollbarServletContextInitializer.java ├── gradle.properties ├── LICENSE ├── .gitignore └── settings.gradle.kts /examples/rollbar-android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /rollbar-api/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | } -------------------------------------------------------------------------------- /native-agent/clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-arguments-threshold = 10 2 | -------------------------------------------------------------------------------- /native-agent/include/jvmti_wrapper.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot3-webmvc/gradle.properties: -------------------------------------------------------------------------------- 1 | ../../gradle.properties -------------------------------------------------------------------------------- /rollbar-java/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /native-agent/src/jvmti.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | include!(concat!(env!("OUT_DIR"), "/jvmti_bindings.rs")); 3 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot3-webmvc/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "rollbar-rollbar-spring-boot3-webmvc-example" 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /rollbar-java/src/test/resources/invalid.payload: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/rollbar-java/src/test/resources/invalid.payload -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gradle" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot-webmvc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | rollbar.access_token = 2 | rollbar.environment = development 3 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot3-webmvc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | rollbar.access_token = 2 | rollbar.environment = development 3 | -------------------------------------------------------------------------------- /rollbar-android/src/main/java/com/rollbar/android/anr/AnrDetector.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.android.anr; 2 | 3 | public interface AnrDetector { 4 | void init(); 5 | } 6 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Android 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollbar/rollbar-java/HEAD/examples/rollbar-android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /rollbar-struts2/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | struts2Version = '2.5.25' 3 | } 4 | 5 | dependencies { 6 | api project(":rollbar-web") 7 | implementation 'org.apache.struts:struts2-core:' + struts2Version 8 | } -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/sender/http/HttpClientFactory.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | interface HttpClientFactory { 4 | AsyncHttpClient build(); 5 | } 6 | -------------------------------------------------------------------------------- /rollbar-log4j2/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(':rollbar-java') 3 | 4 | api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.0' 5 | annotationProcessor 'org.apache.logging.log4j:log4j-core:2.17.0' 6 | } 7 | -------------------------------------------------------------------------------- /rollbar-logback/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(':rollbar-java') 3 | 4 | api group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.14' 5 | api group: 'ch.qos.logback', name: 'logback-core', version: '1.3.14' 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/truncation/StringTruncatable.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.truncation; 2 | 3 | import com.rollbar.api.annotations.Unstable; 4 | 5 | @Unstable 6 | public interface StringTruncatable { 7 | T truncateStrings(int maxLength); 8 | } 9 | -------------------------------------------------------------------------------- /rollbar-web/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | api project(':rollbar-java') 3 | 4 | compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' 5 | 6 | testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' 7 | } -------------------------------------------------------------------------------- /rollbar-android/src/main/java/com/rollbar/android/util/Constants.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.android.util; 2 | 3 | public final class Constants { 4 | 5 | public static final String ROLLBAR_NAMESPACE = "com.rollbar.android"; 6 | 7 | private Constants() {} 8 | 9 | } 10 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot3-webmvc/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /rollbar-android/src/main/java/com/rollbar/android/anr/AnrListener.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.android.anr; 2 | 3 | public interface AnrListener { 4 | /** 5 | * Called when an ANR is detected. 6 | * 7 | * @param error The error describing the ANR. 8 | */ 9 | void onAppNotResponding(AnrException error); 10 | } 11 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/config/Config.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.config; 2 | 3 | import com.rollbar.reactivestreams.notifier.sender.Sender; 4 | 5 | public interface Config extends com.rollbar.notifier.config.CommonConfig { 6 | Sender asyncSender(); 7 | } 8 | -------------------------------------------------------------------------------- /rollbar-reactive-streams-reactor/src/test/java/com/rollbar/reactivestreams/interleave/VMLensTest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.interleave; 2 | 3 | /** 4 | * The category of tests that must run with vmlens instrumentation. 5 | * @see https://vmlens.com 6 | */ 7 | public class VMLensTest { 8 | } 9 | -------------------------------------------------------------------------------- /examples/rollbar-logback/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | jar { 4 | archivesBaseName = "rollbar-java-example" 5 | archiveVersion = '1.0.0' 6 | } 7 | 8 | application { 9 | mainClassName = "com.rollbar.logback.example.Application" 10 | } 11 | 12 | dependencies { 13 | implementation project(":rollbar-logback") 14 | } 15 | -------------------------------------------------------------------------------- /rollbar-spring-webmvc/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | springWebmvcVersion = '5.2.6.RELEASE' 3 | javaxServletVersion = '3.1.0' 4 | } 5 | 6 | dependencies { 7 | api project(":rollbar-web") 8 | implementation 'org.springframework:spring-webmvc:' + springWebmvcVersion 9 | implementation group: 'javax.servlet', name: 'javax.servlet-api', version: javaxServletVersion 10 | } -------------------------------------------------------------------------------- /rollbar-reactive-streams-reactor/src/main/java/com/rollbar/reactivestreams/notifier/sender/http/ReactorAsyncHttpClientFactory.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | class ReactorAsyncHttpClientFactory implements HttpClientFactory { 4 | @Override 5 | public AsyncHttpClient build() { 6 | return new ReactorAsyncHttpClient.Builder().build(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.config; 2 | 3 | public interface ConfigProvider { 4 | /** 5 | * Provides the config given a builder. 6 | * 7 | * @param builder an instance of {@link ConfigBuilder} with defaults set 8 | * @return the config 9 | */ 10 | Config provide(ConfigBuilder builder); 11 | } 12 | -------------------------------------------------------------------------------- /rollbar-spring-boot-webmvc/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | javaxServletVersion = '3.0.1' 3 | springBootVersion = '1.4.2.RELEASE' 4 | } 5 | 6 | dependencies { 7 | api project(':rollbar-spring-webmvc') 8 | 9 | implementation 'org.springframework.boot:spring-boot:' + springBootVersion 10 | implementation group: 'javax.servlet', name: 'javax.servlet-api', version: javaxServletVersion 11 | } -------------------------------------------------------------------------------- /rollbar-struts2/src/test/java/com/rollbar/struts/RollbarFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.struts; 2 | 3 | import static org.junit.Assert.assertNotNull; 4 | 5 | import org.junit.Test; 6 | 7 | public class RollbarFactoryTest { 8 | 9 | @Test 10 | public void testBuild() { 11 | RollbarFactory sut = new RollbarFactory(); 12 | 13 | assertNotNull(sut.build()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /rollbar-reactive-streams-reactor/README.md: -------------------------------------------------------------------------------- 1 | # Rollbar Spring Reactor itegration 2 | 3 | This directory contains the Spring Reactor integration of the Rollbar Java SDK. 4 | 5 | See [examples/rollbar-reactive-streams-reactor](../examples/rollbar-reactive-streams-reactor) for a usage example. 6 | 7 | Instructions for building and contributing to the SDK can be found in the main repository [README](../README.md). 8 | -------------------------------------------------------------------------------- /rollbar-java/src/integTest/java/com/rollbar/notifier/util/ConstantTimeProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.util; 2 | 3 | import com.rollbar.notifier.provider.Provider; 4 | 5 | public class ConstantTimeProvider implements Provider { 6 | 7 | private static final long CURRENT_TIME = System.currentTimeMillis(); 8 | 9 | 10 | @Override 11 | public Long provide() { 12 | return CURRENT_TIME; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/sender/http/AsyncHttpResponse.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * A HTTP server response to an asynchronous request. 7 | */ 8 | public interface AsyncHttpResponse { 9 | int getStatusCode(); 10 | 11 | Iterable> getHeaders(); 12 | 13 | String getBody(); 14 | } 15 | -------------------------------------------------------------------------------- /examples/rollbar-log4j2/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | jar { 4 | archivesBaseName = "rollbar-log4j2-example" 5 | archiveVersion = '1.0.0' 6 | } 7 | 8 | application { 9 | mainClassName = "com.rollbar.log4j2.example.Application" 10 | } 11 | 12 | dependencies { 13 | implementation project(":rollbar-log4j2") 14 | 15 | implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.17.0' 16 | } 17 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/sender/http/ApacheAsyncHttpClientFactory.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | /** 4 | * Factory class for {@link ApacheAsyncHttpClient}. 5 | */ 6 | class ApacheAsyncHttpClientFactory implements HttpClientFactory { 7 | @Override 8 | public AsyncHttpClient build() { 9 | return new ApacheAsyncHttpClient.Builder().build(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/provider/timestamp/TimestampProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.provider.timestamp; 2 | 3 | import com.rollbar.notifier.provider.Provider; 4 | 5 | /** 6 | * Provides the current timestamp from {@link System#currentTimeMillis}. 7 | */ 8 | public class TimestampProvider implements Provider { 9 | 10 | @Override 11 | public Long provide() { 12 | return System.currentTimeMillis(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/uuid/UuidGenerator.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.uuid; 2 | 3 | import com.rollbar.api.payload.data.Data; 4 | 5 | /** 6 | * Interface to generate the UUID of the {@link Data data} to send to Rollbar. 7 | */ 8 | public interface UuidGenerator { 9 | 10 | /** 11 | * Generates the UUID for the data. 12 | * 13 | * @param data the data. 14 | * @return the UUID. 15 | */ 16 | String from(Data data); 17 | } 18 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/json/JsonSerializable.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.json; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * An object that can be serialized to JSON. 7 | */ 8 | public interface JsonSerializable extends Serializable { 9 | 10 | /** 11 | * Returns the object that should be an equivalent representation of itself in json. 12 | * 13 | * @return the json equivalent representation. 14 | */ 15 | Object asJson(); 16 | } 17 | -------------------------------------------------------------------------------- /examples/rollbar-struts2/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%@taglib prefix="s" uri="/struts-tags" %> 6 | 7 | 8 | 9 | Hello Rollbar struts2 example application 10 | 11 | 12 | 13 | Hello Rollbar! 14 | 15 | 16 | -------------------------------------------------------------------------------- /rollbar-android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/payload/data/body/BodyContent.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.payload.data.body; 2 | 3 | import com.rollbar.api.truncation.StringTruncatable; 4 | 5 | /** 6 | * A marker interface for the contents of the rollbar body. 7 | */ 8 | public interface BodyContent extends StringTruncatable { 9 | 10 | /** 11 | * The key name of the body content. 12 | * 13 | * @return the key name. 14 | */ 15 | String getKeyName(); 16 | } 17 | -------------------------------------------------------------------------------- /examples/rollbar-struts2-spring/src/main/webapp/WEB-INF/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%@taglib prefix="s" uri="/struts-tags" %> 6 | 7 | 8 | 9 | Hello Rollbar struts2 example application 10 | 11 | 12 | 13 | Hello Rollbar! 14 | 15 | 16 | -------------------------------------------------------------------------------- /native-agent/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rollbar-java-agent" 3 | version = "0.1.0" 4 | authors = ["Andrew Weiss "] 5 | build = "build.rs" 6 | 7 | [lib] 8 | crate_type = [ "cdylib" ] 9 | 10 | [dependencies] 11 | jni = "0.21.1" 12 | log = "0.4.26" 13 | pretty_env_logger = "0.5.0" 14 | 15 | [dependencies.error-chain] 16 | version = "0.12.0" 17 | default-features = false 18 | 19 | [build-dependencies] 20 | bindgen = "0.71.1" 21 | 22 | [profile.release] 23 | panic = "abort" 24 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /gradle/compatibility.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.palantir.revapi' 2 | 3 | revapi { 4 | oldGroup = GROUP 5 | // By default, revapi will check against the version matching the most recent 6 | // git tag, so we don't need to specify anything else here. 7 | // If an artifact with the given version doesn't exist on maven, it will skip 8 | // the check, so new projects won't cause any failures, and after the first 9 | // version of a project is published it will start checking it. 10 | } 11 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/sender/exception/SenderException.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.sender.exception; 2 | 3 | import com.rollbar.notifier.sender.Sender; 4 | 5 | /** 6 | * Exception to indicate that there was a problem related in the {@link Sender sender}. 7 | */ 8 | public class SenderException extends RuntimeException { 9 | public SenderException(Exception e) { 10 | super(e); 11 | } 12 | 13 | public SenderException(Throwable e) { 14 | super(e); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/rollbar-web/src/main/java/com/rollbar/web/example/server/ServerProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.example.server; 2 | 3 | import com.rollbar.api.payload.data.Server; 4 | import com.rollbar.notifier.provider.Provider; 5 | 6 | public class ServerProvider implements Provider { 7 | 8 | 9 | @Override 10 | public Server provide() { 11 | return new Server.Builder() 12 | .codeVersion("1.0.0") 13 | .branch("master") 14 | .host("localhost") 15 | .build(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/fingerprint/FingerprintGenerator.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.fingerprint; 2 | 3 | import com.rollbar.api.payload.data.Data; 4 | 5 | /** 6 | * Interface to generate the fingerprint of the {@link Data data} to send to Rollbar. 7 | */ 8 | public interface FingerprintGenerator { 9 | 10 | /** 11 | * Generates the fingerprint for the data. 12 | * 13 | * @param data the data. 14 | * @return the fingerprint. 15 | */ 16 | String from(Data data); 17 | } 18 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/provider/Provider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.provider; 2 | 3 | import com.rollbar.notifier.Rollbar; 4 | import com.rollbar.notifier.config.Config; 5 | 6 | /** 7 | * Provider interface used to retrieve different data by {@link Rollbar the notifier} through the 8 | * {@link Config config} supplied to it. 9 | */ 10 | public interface Provider { 11 | 12 | /** 13 | * Provides the value. 14 | * 15 | * @return the value. 16 | */ 17 | T provide(); 18 | } 19 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot-webmvc/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.7.12' 3 | id 'io.spring.dependency-management' version '1.0.15.RELEASE' 4 | id 'java' 5 | } 6 | 7 | ext { 8 | springBootStarterVersion = '2.2.7.RELEASE' 9 | } 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | implementation project(':rollbar-spring-boot-webmvc') 17 | implementation 'org.springframework.boot:spring-boot-starter-web:' + springBootStarterVersion 18 | } 19 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot3-webmvc/src/main/java/com/example/springbootwebmvc/ExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootwebmvc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ExampleApplication { 8 | /** 9 | * Starts the Spring boot application. 10 | */ 11 | public static void main(String[] args) { 12 | SpringApplication.run(ExampleApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/rollbar-java/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Rollbar logger 5 | log4j.logger.com.rollbar.notifier=DEBUG, stdout 6 | log4j.additivity.com.rollbar.notifier = false 7 | 8 | # Direct log messages to stdout 9 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 10 | log4j.appender.stdout.Target=System.out 11 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 12 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/transformer/Transformer.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.transformer; 2 | 3 | import com.rollbar.api.payload.data.Data; 4 | 5 | /** 6 | * Transformer interface to process the data before sending it to Rollbar.. 7 | */ 8 | public interface Transformer { 9 | 10 | /** 11 | * Transforms the incoming data into other data that will be returned. 12 | * 13 | * @param data the data to transform. 14 | * @return the data transformed. 15 | */ 16 | Data transform(Data data); 17 | } 18 | -------------------------------------------------------------------------------- /rollbar-android/src/main/java/com/rollbar/android/anr/watchdog/LooperHandler.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.android.anr.watchdog; 2 | 3 | import android.os.Handler; 4 | import android.os.Looper; 5 | 6 | public class LooperHandler { 7 | private final Handler handler; 8 | LooperHandler() { 9 | this.handler = new Handler(Looper.getMainLooper()); 10 | } 11 | 12 | public void post(Runnable runnable) { 13 | handler.post(runnable); 14 | } 15 | 16 | public Thread getThread() { 17 | return handler.getLooper().getThread(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/test/java/com/rollbar/reactivestreams/notifier/sender/http/AsyncHttpClientFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | import static org.junit.Assert.assertThat; 4 | 5 | import org.hamcrest.Matchers; 6 | import org.junit.Test; 7 | 8 | public class AsyncHttpClientFactoryTest { 9 | @Test 10 | public void ifApacheIsInClasspathItShouldReturnApacheClient() { 11 | assertThat(AsyncHttpClientFactory.defaultClient(), Matchers.instanceOf(ApacheAsyncHttpClient.class)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/rollbar-spring-boot-webmvc/src/main/java/com/example/springbootwebmvc/ExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.springbootwebmvc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ExampleApplication { 8 | 9 | /** 10 | * Starts the Spring boot application. 11 | */ 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(ExampleApplication.class, args); 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/test/java/com/rollbar/example/android/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.example.android; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/rollbar-web/src/main/java/com/rollbar/web/example/config/MyConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.example.config; 2 | 3 | import com.rollbar.notifier.config.Config; 4 | import com.rollbar.notifier.config.ConfigBuilder; 5 | import com.rollbar.notifier.config.ConfigProvider; 6 | import com.rollbar.web.example.server.ServerProvider; 7 | 8 | public class MyConfigProvider implements ConfigProvider { 9 | 10 | @Override 11 | public Config provide(ConfigBuilder builder) { 12 | return builder.server(new ServerProvider()).build(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rollbar-reactive-streams-reactor/src/test/java/com/rollbar/reactivestreams/notifier/sender/http/AsyncHttpClientFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | import static org.hamcrest.MatcherAssert.assertThat; 4 | 5 | import org.hamcrest.Matchers; 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class AsyncHttpClientFactoryTest { 9 | @Test 10 | public void ifReactorIsInClasspathItShouldReturnReactorClient() { 11 | assertThat(AsyncHttpClientFactory.defaultClient(), Matchers.instanceOf(ReactorAsyncHttpClient.class)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /rollbar-web/src/test/java/com/rollbar/web/config/FakeConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.config; 2 | 3 | import com.rollbar.notifier.config.Config; 4 | import com.rollbar.notifier.config.ConfigBuilder; 5 | import com.rollbar.notifier.config.ConfigProvider; 6 | 7 | public class FakeConfigProvider implements ConfigProvider { 8 | 9 | public static boolean CALLED = false; 10 | 11 | public FakeConfigProvider() { 12 | CALLED = true; 13 | } 14 | 15 | @Override 16 | public Config provide(ConfigBuilder builder) { 17 | return builder.build(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rollbar-jakarta-web/src/test/java/com/rollbar/web/config/FakeConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.config; 2 | 3 | import com.rollbar.notifier.config.Config; 4 | import com.rollbar.notifier.config.ConfigBuilder; 5 | import com.rollbar.notifier.config.ConfigProvider; 6 | 7 | public class FakeConfigProvider implements ConfigProvider { 8 | 9 | public static boolean CALLED = false; 10 | 11 | public FakeConfigProvider() { 12 | CALLED = true; 13 | } 14 | 15 | @Override 16 | public Config provide(ConfigBuilder builder) { 17 | return builder.build(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/rollbar-struts2-spring/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rollbar-jakarta-web/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | jakartaServletVersion = '6.0.0' 3 | } 4 | 5 | java { 6 | toolchain { 7 | languageVersion = JavaLanguageVersion.of(11) 8 | } 9 | } 10 | 11 | compileJava { 12 | options.release = 11 13 | } 14 | 15 | compileTestJava { 16 | options.release = 11 17 | } 18 | 19 | dependencies { 20 | api project(':rollbar-java') 21 | 22 | compileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: jakartaServletVersion 23 | 24 | testImplementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: jakartaServletVersion 25 | } 26 | -------------------------------------------------------------------------------- /rollbar-spring6-webmvc/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | springWebmvcVersion = '6.0.0' 3 | jakartaServletVersion = '6.0.0' 4 | } 5 | 6 | java { 7 | toolchain { 8 | languageVersion = JavaLanguageVersion.of(17) 9 | } 10 | } 11 | 12 | compileJava { 13 | options.release = 17 14 | } 15 | 16 | compileTestJava { 17 | options.release = 17 18 | } 19 | 20 | dependencies { 21 | api project(":rollbar-jakarta-web") 22 | implementation 'org.springframework:spring-webmvc:' + springWebmvcVersion 23 | implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: jakartaServletVersion 24 | } 25 | -------------------------------------------------------------------------------- /rollbar-spring-boot3-webmvc/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | jakartaServletVersion = '6.0.0' 3 | springBootVersion = '3.0.0' 4 | } 5 | 6 | java { 7 | toolchain { 8 | languageVersion = JavaLanguageVersion.of(17) 9 | } 10 | } 11 | 12 | compileJava { 13 | options.release = 17 14 | } 15 | 16 | compileTestJava { 17 | options.release = 17 18 | } 19 | 20 | dependencies { 21 | api project(':rollbar-spring6-webmvc') 22 | 23 | implementation 'org.springframework.boot:spring-boot:' + springBootVersion 24 | implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: jakartaServletVersion 25 | } 26 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/payload/data/TelemetryType.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.payload.data; 2 | 3 | import com.rollbar.api.json.JsonSerializable; 4 | 5 | /** 6 | * Represents the different types of {@link TelemetryEvent} available. 7 | */ 8 | public enum TelemetryType implements JsonSerializable { 9 | LOG("log"), 10 | MANUAL("manual"), 11 | NAVIGATION("navigation"), 12 | NETWORK("network"); 13 | 14 | private final String jsonName; 15 | 16 | TelemetryType(String jsonName) { 17 | this.jsonName = jsonName; 18 | } 19 | 20 | @Override 21 | public Object asJson() { 22 | return jsonName; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rollbar-java/src/integTest/java/com/rollbar/notifier/util/json/LevelSerializer.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.util.json; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonPrimitive; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | import com.rollbar.api.payload.data.Level; 8 | import java.lang.reflect.Type; 9 | 10 | public class LevelSerializer implements JsonSerializer { 11 | 12 | @Override 13 | public JsonElement serialize(Level src, Type typeOfSrc, JsonSerializationContext context) { 14 | return new JsonPrimitive(src.name().toLowerCase()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/payload/data/Source.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.payload.data; 2 | 3 | import com.rollbar.api.json.JsonSerializable; 4 | 5 | /** 6 | * The Source of a payload. 7 | */ 8 | public enum Source implements JsonSerializable { 9 | 10 | /** 11 | * A Client source (e.g. Android) 12 | */ 13 | CLIENT("client"), 14 | 15 | /** 16 | * A Server source (e.g. Spring) 17 | */ 18 | SERVER("server"); 19 | 20 | private final String jsonName; 21 | 22 | Source(String jsonName) { 23 | this.jsonName = jsonName; 24 | } 25 | 26 | @Override 27 | public Object asJson() { 28 | return jsonName; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/config/Config.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.config; 2 | 3 | import com.rollbar.notifier.Rollbar; 4 | import com.rollbar.notifier.sender.Sender; 5 | import com.rollbar.notifier.sender.json.JsonSerializer; 6 | 7 | import java.net.Proxy; 8 | 9 | /** 10 | * The configuration for the {@link Rollbar notifier}. 11 | */ 12 | public interface Config extends CommonConfig { 13 | /** 14 | * Get the {@link Sender sender}. 15 | * 16 | * @return the sender. 17 | */ 18 | Sender sender(); 19 | 20 | /** 21 | * Get the {@link Proxy proxy}. 22 | * 23 | * @return the proxy. 24 | */ 25 | Proxy proxy(); 26 | } 27 | -------------------------------------------------------------------------------- /rollbar-java/src/main/java/com/rollbar/notifier/truncation/StringsStrategy.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.notifier.truncation; 2 | 3 | import com.rollbar.api.payload.Payload; 4 | 5 | class StringsStrategy implements TruncationStrategy { 6 | private final int stringLength; 7 | 8 | public StringsStrategy(int stringLength) { 9 | this.stringLength = stringLength; 10 | } 11 | 12 | @Override 13 | public TruncationResult truncate(Payload payload) { 14 | if (payload == null || payload.getData() == null) { 15 | return TruncationResult.none(); 16 | } 17 | 18 | return TruncationResult.truncated(payload.truncateStrings(stringLength)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/rollbar-reactive-streams-reactor/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=INFO, stdout 3 | 4 | # Rollbar logger 5 | log4j.logger.com.rollbar.notifier=DEBUG, stdout 6 | log4j.additivity.com.rollbar.notifier=false 7 | log4j.logger.com.rollbar.reactivestreams.notifier=DEBUG, stdout 8 | log4j.additivity.com.rollbar.reactivestreams.notifier=false 9 | 10 | # Direct log messages to stdout 11 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 12 | log4j.appender.stdout.Target=System.out 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 15 | -------------------------------------------------------------------------------- /rollbar-spring-webmvc/src/main/java/com/rollbar/spring/webmvc/RollbarWebApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.spring.webmvc; 2 | 3 | import com.rollbar.web.listener.RollbarRequestListener; 4 | import javax.servlet.ServletContext; 5 | import org.springframework.web.WebApplicationInitializer; 6 | 7 | public class RollbarWebApplicationInitializer implements WebApplicationInitializer { 8 | 9 | @Override 10 | public void onStartup(ServletContext container) { 11 | 12 | // Attach the RollbarRequestListner to attribute HTTP Request data into the Exception object 13 | // This will be visible in Rollbar 14 | container.addListener(RollbarRequestListener.class); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /rollbar-spring6-webmvc/src/main/java/com/rollbar/spring/webmvc/RollbarWebApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.spring.webmvc; 2 | 3 | import com.rollbar.web.listener.RollbarRequestListener; 4 | import jakarta.servlet.ServletContext; 5 | import org.springframework.web.WebApplicationInitializer; 6 | 7 | public class RollbarWebApplicationInitializer implements WebApplicationInitializer { 8 | 9 | @Override 10 | public void onStartup(ServletContext container) { 11 | 12 | // Attach the RollbarRequestListner to attribute HTTP Request data into the Exception object 13 | // This will be visible in Rollbar 14 | container.addListener(RollbarRequestListener.class); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /rollbar-android/src/main/java/com/rollbar/android/anr/AnrException.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.android.anr; 2 | 3 | import com.rollbar.api.payload.data.body.RollbarThread; 4 | 5 | import java.util.List; 6 | 7 | public final class AnrException extends RuntimeException { 8 | 9 | private List threads; 10 | 11 | public AnrException(String message, Thread thread) { 12 | super(message); 13 | setStackTrace(thread.getStackTrace()); 14 | } 15 | 16 | public AnrException(List threads) { 17 | super("Application Not Responding"); 18 | this.threads = threads; 19 | } 20 | 21 | public List getThreads() { 22 | return threads; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /examples/rollbar-log4j2/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | [ACCESS_TOKEN]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/rollbar-scala/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'scala' 2 | apply plugin: 'application' 3 | 4 | repositories { 5 | mavenCentral() 6 | } 7 | 8 | application { 9 | mainClassName = "com.rollbar.example.Application" 10 | } 11 | 12 | // Uncomment the block below to use the native agent to add local variables to stack traces 13 | // This assumes you have run `cargo build --release` inside the native-agent directory 14 | /* 15 | applicationDefaultJvmArgs = [ 16 | "-agentpath:../../native-agent/target/release/"+System.mapLibraryName("rollbar_java_agent") 17 | ] 18 | */ 19 | 20 | dependencies { 21 | implementation project(":rollbar-java") 22 | 23 | implementation "org.scala-lang:scala-library:2.13.14" 24 | } 25 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/sender/Sender.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender; 2 | 3 | import com.rollbar.api.payload.Payload; 4 | import com.rollbar.notifier.sender.result.Response; 5 | import org.reactivestreams.Publisher; 6 | 7 | /** 8 | * Sender interface to asynchronously send the payload to Rollbar. 9 | */ 10 | public interface Sender extends AutoCloseable { 11 | /** 12 | * Sends the payload. 13 | * 14 | * @param payload the payload. 15 | * @return A {@link Publisher} that will execute the operation once a subscriber requests it. 16 | */ 17 | Publisher send(Payload payload); 18 | 19 | void close(boolean wait); 20 | } 21 | -------------------------------------------------------------------------------- /examples/rollbar-reactive-streams-reactor/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | jar { 4 | archivesBaseName = "rollbar-reactive-streams-reactor-example" 5 | archiveVersion = '0.1.0' 6 | } 7 | 8 | application { 9 | mainClassName = "com.rollbar.reactivestreams.reactor.example.Application" 10 | } 11 | 12 | dependencies { 13 | implementation project(":rollbar-reactive-streams-reactor") 14 | 15 | implementation platform('io.projectreactor:reactor-bom:2020.0.6') 16 | implementation 'io.projectreactor:reactor-core' 17 | implementation 'io.projectreactor:reactor-tools' 18 | implementation 'io.projectreactor.netty:reactor-netty-http' 19 | 20 | implementation 'org.slf4j:slf4j-log4j12:1.7.25' 21 | } 22 | -------------------------------------------------------------------------------- /rollbar-reactive-streams/src/main/java/com/rollbar/reactivestreams/notifier/sender/http/AsyncHttpRequest.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.reactivestreams.notifier.sender.http; 2 | 3 | import java.util.Map; 4 | import java.util.Set; 5 | 6 | /** 7 | * Data for an asynchronous, non-blocking HTTP request. 8 | */ 9 | public interface AsyncHttpRequest { 10 | String getUrl(); 11 | 12 | Iterable> getHeaders(); 13 | 14 | String getBody(); 15 | 16 | class Builder { 17 | public static AsyncHttpRequest build(String url, Set> headers, 18 | String reqBody) { 19 | return new AsyncHttpRequestImpl(url, headers, reqBody); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /rollbar-api/src/main/java/com/rollbar/api/annotations/Unstable.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.api.annotations; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | 7 | /** 8 | *

9 | * Classes and methods annotated with {@link Unstable} will likely change in ways that will break 10 | * backwards compatibility, both at source and binary level. 11 | *

12 | */ 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | public @interface Unstable { 16 | String reason = "This class or method is not part of the SDK's public API, and will likely " 17 | + "change in ways that will break backwards compatibility, both at source and binary level."; 18 | } 19 | -------------------------------------------------------------------------------- /examples/rollbar-struts2/src/main/java/com/example/rollbar/struts2/action/HelloRollbarAction.java: -------------------------------------------------------------------------------- 1 | package com.example.rollbar.struts2.action; 2 | 3 | import com.opensymphony.xwork2.ActionSupport; 4 | import java.util.concurrent.atomic.AtomicInteger; 5 | 6 | 7 | /** 8 | * Struts2 action that rises an error every even request number. 9 | */ 10 | public class HelloRollbarAction extends ActionSupport { 11 | 12 | private static final AtomicInteger counter = new AtomicInteger(1); 13 | 14 | public String execute() { 15 | int current = counter.getAndAdd(1); 16 | if (current % 2 == 0) { 17 | throw new RuntimeException("Fatal error at hello rollbar action. Number: " + current); 18 | } 19 | return SUCCESS; 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /rollbar-web/src/main/java/com/rollbar/web/provider/PersonProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.provider; 2 | 3 | import com.rollbar.api.payload.data.Person; 4 | import com.rollbar.notifier.provider.Provider; 5 | import com.rollbar.web.listener.RollbarRequestListener; 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | public class PersonProvider implements Provider { 9 | 10 | @Override 11 | public Person provide() { 12 | HttpServletRequest request = RollbarRequestListener.getServletRequest(); 13 | 14 | if (request != null && request.getUserPrincipal() != null) { 15 | return new Person.Builder() 16 | .id(request.getUserPrincipal().getName()) 17 | .build(); 18 | } 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=2.1.0 2 | GROUP=com.rollbar 3 | 4 | android.useAndroidX=true 5 | org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 6 | 7 | POM_DESCRIPTION=For connecting your applications built on the JVM to Rollbar for Error Reporting 8 | POM_URL=https://github.com/rollbar/rollbar-java 9 | POM_SCM_URL=https://github.com/rollbar/rollbar-java 10 | POM_SCM_CONNECTION=scm:git:git@github.com:rollbar/rollbar-java.git 11 | POM_SCM_DEV_CONNECTION=scm:git:git@github.com:rollbar/rollbar-java.git 12 | POM_LICENCE_NAME=MIT License 13 | POM_LICENCE_URL=http://www.opensource.org/licenses/mit-license.php 14 | POM_LICENCE_DIST=repo 15 | 16 | POM_NAME=rollbar 17 | POM_ARTIFACT_ID=rollbar 18 | POM_PACKAGING=jar 19 | -------------------------------------------------------------------------------- /rollbar-jakarta-web/src/main/java/com/rollbar/web/provider/PersonProvider.java: -------------------------------------------------------------------------------- 1 | package com.rollbar.web.provider; 2 | 3 | import com.rollbar.api.payload.data.Person; 4 | import com.rollbar.notifier.provider.Provider; 5 | import com.rollbar.web.listener.RollbarRequestListener; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | 8 | public class PersonProvider implements Provider { 9 | 10 | @Override 11 | public Person provide() { 12 | HttpServletRequest request = RollbarRequestListener.getServletRequest(); 13 | 14 | if (request != null && request.getUserPrincipal() != null) { 15 | return new Person.Builder() 16 | .id(request.getUserPrincipal().getName()) 17 | .build(); 18 | } 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/rollbar-java/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | jar { 4 | archivesBaseName = "rollbar-java-example" 5 | archiveVersion = '1.0.0' 6 | } 7 | 8 | application { 9 | mainClassName = "com.rollbar.example.Application" 10 | } 11 | 12 | // Uncomment the block below to use the native agent to add local variables to stack traces 13 | // This assumes you have run `cargo build --release` inside the native-agent directory 14 | /* 15 | applicationDefaultJvmArgs = [ 16 | "-agentpath:../../native-agent/target/release/"+System.mapLibraryName("rollbar_java_agent"), 17 | ] 18 | */ 19 | 20 | dependencies { 21 | implementation project(":rollbar-java") 22 | 23 | implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25' 24 | } 25 | -------------------------------------------------------------------------------- /.github/scripts/fetch_to_tag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # Github actions will do shallow clones which is great for performance, but some of our 6 | # tasks require a history going back to the most recent tag, so this script achieves 7 | # that, without pulling the full history 8 | 9 | function fetch_to_tag() { 10 | n="$1" 11 | if [ "$n" == "" ]; then 12 | n=2 13 | fi 14 | 15 | echo "Fetching commits with depth ${n}" 16 | 17 | rev=$(git rev-list -n 1 HEAD) 18 | 19 | git fetch origin --depth "$n" "$rev" 20 | 21 | if ! git describe --tags --abbrev=0 HEAD^ 1>/dev/null 2>&1; then 22 | fetch_to_tag "$(expr "$n" \* 2)" 23 | fi 24 | } 25 | 26 | git fetch origin 'refs/tags/*:refs/tags/*' 27 | 28 | fetch_to_tag 29 | -------------------------------------------------------------------------------- /examples/rollbar-android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 14 |