Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 581241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:33:28+00:00 2026-05-13T14:33:28+00:00

Is there a way to log all exceptions happening within JVM? A system is

  • 0

Is there a way to log all exceptions happening within JVM?

A system is built from a big number of smaller components provided by different groups. All of them are running within the same JVM (under Weblogic).

Error reporting policies are rather different in those groups, so sometimes we have cases of suppressed exceptions, which makes troubleshooting very hard. At the same time, I noticed that JDB is able to intercept any exception happening in the code, no matter where.

I’d like to use the same facility JDB uses in DEV/SIT/UAT environment to shorten issue resolution time. In PTE and PROD though the facility shall not only be turned off, but

  • create no performance impact
  • require no code change for turning it off.

Of course, I can have JDB connected to every instance of server running in DEV/SIT. It’s feasible, I guess… but there are two main downside:

  • it makes configuration more complex
  • JDB stops when an exception has occured; need a script or something to let it continue

So I wonder is there any method that does it, e.g. Runtime.traceExceptions(…)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:33:28+00:00Added an answer on May 13, 2026 at 2:33 pm

    As far as I know there is no official Java API for this besides the debugging API which could be used also from inside the VM that is about to be ‘debugged’.

    An easier quick and dirty way to get notified of every exception that is created at runtime is to hack some tracing code directly into the constructor(s) of the Throwable class, compile it and put it into the bootclasspath before the rt.jar. This is of course nothing you should do in a release version but it can be very helpfull to analyse code that catches exceptions somewhere and doesn’t report them properly.

    In response to the comments:

    Regarding the Debugger API: The last time I did something like this I used the JVMDI to build a native JNI/JVMDI dll and accessed it from inside the VM. It works and lets you do all sorts of wired things that Java normally doesn’t offer but I would consider this even more of a hack than using a patched Throwable class. Besides that, the JVMDI has been deprecated and was replaced with JVM TI since Java 1.6. I don’t know if and how you can do something like this with this new Debugger API as well.

    Using a modified Throwable is fast, easy to get right, doesn’t impose any performance degeneration by itself and also not even really hackish if you are in control over the execution environment. You could think of as some kind of AOP. 😉 But I would still only use it to find otherwise hard to detect bugs and not in production code or only as a last resort. Something like this should surely not be considered as part of the design. The best long term approach would be to get all your development groups to agree on some common exception treatment.

    Also FindBugs can help a lot if you decide to do a code review to find all these spots where exceptions get caught and not reported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way to log all exceptions in an ASP.NET application? I'm
Is there any way to access the Windows Event Log from a java class.
Is there any way to handle all Errors Exceptions and crashes in WPF application?
Is there a way to log(/var/log) commands executed by users in the Unix shell?
Is there any way to view the activity log for the integrate SourceSafe inside
Is there a way to edit the log message of a certain revision in
Is there a way to tell SQL Server 2008 Express to log every query
Is there a way to write log4j logging events to a log file that
Is there a way I can set up callbacks on (or automataically log) method
do you have idea, if there would be some nice way to browse/log JMS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.