Created
July 13, 2016 22:41
-
-
Save tnhu/eaa01bf5e5d96d24e41e08f91f471db2 to your computer and use it in GitHub Desktop.
Dump Java stack trace without throwing an exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.lang3.exception.ExceptionUtils; | |
import play.Logger; | |
String stackTrace = ExceptionUtils.getStackTrace(new Exception())); | |
// Log warning with stack trace for a deprecated method | |
Logger.warn("Method is deprecated: " + stackTrace); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment