# Method with @async annotation, not getting logged in APM for errors for spring application

**URL:** <https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315741>\
**Category:** Elasticsearch\
**Created:** [October 4, 2022, 6:59am UTC](https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315741 "2022-10-04T06:59:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jawed-Aquib](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jawed-aquib/32/111633_2.png) [@Jawed-Aquib](https://discuss.elastic.co/u/Jawed-Aquib)\
**Post date:** [October 4, 2022, 6:59am UTC](https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315741/1 "2022-10-04T06:59:13Z")

</div>

I have configured the java APM agent through the elastic.apm.service\_name config for my springboot application.

 ![MicrosoftTeams-image (33)](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f74a2d4b3bfcdfc0f6c215e1f72b7da7a558abd2.jpeg)  
When there is any error occurring for my method annotated with @Async the error form this isn't availble at the APM side. The code snippet where this issue occurs is .

```auto
 @Async("AsyncConfigPayAgg")
    public void submitPaymentToComplianceAndUpdateNano(PaymentDetails paymentDetails, Customer customer,
            List<RuleResponse> ruleResponseList) {
        try {
            LogUtil.log(LOGGER, "Active threads for comply::" + asyncConfigPayAgg.getActiveCount());
            APIResponse<?> compliResponse = submitTransactionForCompliance(paymentDetails,
                    PaymentDirectionEnum.OUTGOING, customer, ruleResponseList);

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 4, 2022, 7:00am UTC](https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315741/2 "2022-10-04T07:00:52Z")

</div>

You've already asked this at [Method with @async annotation, not getting logged in APM for errors for spring application](https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315739), so let's keep the discussion happening there 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 4, 2022, 7:00am UTC](https://discuss.elastic.co/t/method-with-async-annotation-not-getting-logged-in-apm-for-errors-for-spring-application/315741/3 "2022-10-04T07:00:59Z")

</div>


