You can use Thread.currentThread().getStackTrace()
.
That returns an array of StackTraceElement
s that represent the current stack trace of a program.
More Related Contents:
- What is a stack trace, and how can I use it to debug my application errors?
- Official reasons for “Software caused connection abort: socket write error”
- How do I find the caller of a method using stacktrace or reflection?
- How can I convert a stack trace to a string?
- How to read and understand the java stack trace? [duplicate]
- Why is exception.printStackTrace() considered bad practice?
- (Unknown Source) in Exception stack trace
- Java / Android – How to print out a full stack trace?
- Determining Current Call Stack (For Diagnostic Purposes)
- How to get arguments passed to method that called this method?
- How to send a stacktrace to log4j?
- NullPointerException stack trace not available without debug agent
- Print full call stack on printStackTrace()?
- How do I stop stacktraces truncating in logs
- Exception without stack trace in Java
- Log4j formatting: Is it possible to truncate stacktraces?
- How to get a complete stack trace of a running java program that is taking 100% cpu?
- How to click an element in Selenium WebDriver using JavaScript?
- Time comparison
- Is it possible to make anonymous inner classes in Java static?
- Convert BufferedInputStream into image [duplicate]
- Convert integer value to matching Java Enum
- Hibernate Group by Criteria Object
- Where to put a textfile I want to use in eclipse?
- How to call Java code from C#?
- How set up Spring Boot to run HTTPS / HTTP ports
- Integer.parseInt(scanner.nextLine()) vs scanner.nextInt()
- Why jdk code style uses a variable assignment and read on the same line – eg. (i=2) < max
- How to wait until an element no longer exists in Selenium
- xjc: Two declarations cause a collision in the ObjectFactory class