public static void printAllStackTraces ( final String filter , final Logger logger , final LogLevel logLevel ) { for ( Map . Entry < Thread , StackTraceElement [ ] > entry : Thread . getAllStackTraces ( ) . entrySet ( ) ) { if ( filter == null || entry . getKey ( ) . getName ( ) . contains ( filter ) ) { StackTracePrinter . printStackTrace ( "Thread[" + entry . getKey ( ) . getName ( ) + "] state[" + entry . getKey ( ) . getState ( ) . name ( ) + "]" , entry . getValue ( ) , logger , logLevel ) ; } } }
Method prints the stack traces of all running java threads via the given logger .