ExceptionBuddy is a Java agent for comprehensive exception monitoring and logging through runtime instrumentation. It captures exceptions across the JVM, including caught exceptions, to improve debugging and production diagnostics.
- Complete exception capture across the JVM
- Non-invasive instrumentation (no application code changes)
- Configurable stack-trace filtering
- Optional class-loader tracing
- Runtime exception statistics monitoring
- Runtime attach support via Attach API
- Optional JVM system property dump
- Optional environment variable dump
ExceptionBuddy instruments java.lang.Throwable using the Java Instrumentation API. By instrumenting the base exception type, it captures exception creation events regardless of where they are later handled.
- Java 8 or higher
- A target JVM application
java -javaagent:C:\tools\ExceptionBuddy-1.0-SNAPSHOT.jar=configurationFile=C:\tools\ebConfig.json -jar your-application.jarjava -cp ExceptionBuddy-1.0-SNAPSHOT.jar com.asm.eb.attach.AgentAttachCLI --agentJar C:\tools\ExceptionBuddy-1.0-SNAPSHOT.jar --configurationFile C:\tools\ebConfig.json --pid <target-jvm-pid>Create ebConfig.json:
{
"useFilters": true,
"filters": ["org.apache.logging.log4j"],
"logFilePath": "C:\\tools\\eb.log",
"classLoaderTracing": false,
"exceptionMonitoring": false,
"cnfSkipString": "java.lang.ClassLoader.loadClass(ClassLoader.java:406)",
"printJVMSysProps": false,
"printEnvironmentVariables": false
}Notes:
classLoaderTracingcan produce high log volume and should be enabled only for focused diagnostics.printJVMSysPropsandprintEnvironmentVariablescan expose secrets; keep them disabled by default in production.- If
useFiltersistrue,filtersmust contain at least one non-empty entry. - Runtime config reload is not supported yet; config is read once at startup attach or runtime attach.
git clone https://github.com/AshutoshIWNL/ExceptionBuddy.git
cd ExceptionBuddy
mvn clean test packageContributions are welcome through issues and pull requests.