Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Throwable: ... Arrays.stream(throwable.getStackTrace()) .limit(yourIntLimit) .forEach(stackTraceElement -> log.error(stackTraceElement.toString())); ... ...
Answer
#3: Post edited
```- Throwable:
- ...
- Arrays.stream(throwable.getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Thread:
- ```
- ...
- Arrays.stream(Thread.currentThread().getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Contributing:
- Thread.currentThread(),
- thank you mikea,
- <https://stackoverflow.com/a/21706861>
- Throwable:
- ```
- ...
- Arrays.stream(throwable.getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Thread:
- ```
- ...
- Arrays.stream(Thread.currentThread().getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Contributing:
- Thread.currentThread(),
- thank you mikea,
- <https://stackoverflow.com/a/21706861>
#2: Post edited
- ```
- Throwable:
- ...
- Arrays.stream(throwable.getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Thread:
- ```
- ...
- Arrays.stream(Thread.currentThread().getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
```
- ```
- Throwable:
- ...
- Arrays.stream(throwable.getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Thread:
- ```
- ...
- Arrays.stream(Thread.currentThread().getStackTrace())
- .limit(yourIntLimit)
- .forEach(stackTraceElement ->
- log.error(stackTraceElement.toString()));
- ...
- ```
- Contributing:
- Thread.currentThread(),
- thank you mikea,
- <https://stackoverflow.com/a/21706861>
#1: Initial revision
``` Throwable: ... Arrays.stream(throwable.getStackTrace()) .limit(yourIntLimit) .forEach(stackTraceElement -> log.error(stackTraceElement.toString())); ... ``` Thread: ``` ... Arrays.stream(Thread.currentThread().getStackTrace()) .limit(yourIntLimit) .forEach(stackTraceElement -> log.error(stackTraceElement.toString())); ... ```