# Error logs not coming in for @Async method in using Java APM agent for SpringBoot application

**URL:** <https://discuss.elastic.co/t/error-logs-not-coming-in-for-async-method-in-using-java-apm-agent-for-springboot-application/315743>\
**Category:** APM\
**Tags:** java\
**Created:** [October 4, 2022, 7:06am UTC](https://discuss.elastic.co/t/error-logs-not-coming-in-for-async-method-in-using-java-apm-agent-for-springboot-application/315743 "2022-10-04T07:06:24Z")\
**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, 7:06am UTC](https://discuss.elastic.co/t/error-logs-not-coming-in-for-async-method-in-using-java-apm-agent-for-springboot-application/315743/1 "2022-10-04T07:06:24Z")

</div>

I have configured the java APM agent through the elastic.apm.service\_name config for my spring-boot 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 from this isn't available 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:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [October 4, 2022, 1:08pm UTC](https://discuss.elastic.co/t/error-logs-not-coming-in-for-async-method-in-using-java-apm-agent-for-springboot-application/315743/2 "2022-10-04T13:08:43Z")

</div>

Sorry, I may be misunderstanding here. The agent doesn't get loaded just be setting the service name, it needs [more setup](https://www.elastic.co/guide/en/apm/agent/java/current/setup.html). Have you configured your applications to run with the agent?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 1, 2022, 1:08pm UTC](https://discuss.elastic.co/t/error-logs-not-coming-in-for-async-method-in-using-java-apm-agent-for-springboot-application/315743/3 "2022-11-01T13:08:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
