I would like to somehow log every time Thread.interrupt()
is called, logging which Thread issued the call (and its current stack) as well as identifying information
As others have said... If it is a one-time thing JVMTI is probably the most hardcore way to go. However, just as fun could be to use the asm library and the instrumentation APIs to create an agent that inserts a call to a static method you've created just before the Thread.interrupt() call (or maybe alters the Thread.interrupt() method to do the same, I think you can do that).
Both takes some time to learn but it is quite fun to work with and once you get the hold of it you can use them for all kinds of funny things in the future :-) I don't really have any good snippets to paste here right now but if you google around for ASM and maybe look at the JIP for some creative use of ASM I think you will find inspiration.
JIP: Java Interactive Profiler