You can use Thread.currentThread().getStackTrace()
.
That returns an array of StackTraceElement
s that represent the current stack trace of a program.
Related Contents:
- How can I convert a stack trace to a string?
- What is a stack trace, and how can I use it to debug my application errors?
- How do I find the caller of a method using stacktrace or reflection?
- e.printStackTrace equivalent in python
- How to store printStackTrace into a string [duplicate]
- Is there a way to dump a stack trace without throwing an exception in java?
- How to send a stacktrace to log4j?
- Official reasons for “Software caused connection abort: socket write error”
- Java / Android – How to print out a full stack trace?
- Why is exception.printStackTrace() considered bad practice?
- How do I stop stacktraces truncating in logs
- How to log exceptions in Java?
- How to read and understand the java stack trace? [duplicate]
- How to read the full stacktrace in Java where it says e.g. “… 23 more”
- Exception without stack trace in Java
- How do I log a stacktrace using java’s Logger class
- NullPointerException stack trace not available without debug agent
- (Unknown Source) in Exception stack trace
- e.printStackTrace(); in string
- Determining Current Call Stack (For Diagnostic Purposes)
- Getting stacktrace in logger
- Print full call stack on printStackTrace()?
- How to programmatically set drawableLeft on Android button?
- What is meant by immutable?
- Get integer value of the current year in Java
- How to import a jar in Eclipse?
- How to timeout a thread
- Display current time in 12 hour format with AM/PM
- Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim)
- Is the order guaranteed for the return of keys and values from a LinkedHashMap object?
- Programmatically shut down Spring Boot application
- Deprecated ManagedQuery() issue
- Java error: Comparison method violates its general contract
- Java – Check Not Null/Empty else assign default value
- Autowire reference beans into list by type
- How to load Classes at runtime from a folder or JAR?
- Android Service needs to run always (Never pause or stop)
- Condition vs wait notify mechanism
- How can a class have a member of its own type, isn’t this infinite recursion?
- Can anyone recommend a simple Java web-app framework? [closed]
- MS SQL Exception: Incorrect syntax near ‘@P0’
- SSLHandshakeException: No subject alternative names present
- Use with HashMap [duplicate]
- Java: Static transient fields
- JDBC ResultSet get columns with table alias
- Can you recommend a Java library for reading (and possibly writing) CSV files? [closed]
- Using Mockito to mock a local variable of a method
- JIT not optimizing loop that involves Integer.MAX_VALUE
- How do I specify the JDK for a GlassFish domain?
- application context. What is this?