I would like to have my own java code run when anything is written to stderr, but can't seem to find a way to do this generically. The goal is to either receive a callback or override something that prints to the error console perhaps where anytime an error is written such as with log's error function or Exception's printStackTrace, my code would be able to intercept the text. How might this be possible in Java?