# Correlating logs to single spans

**URL:** <https://discuss.elastic.co/t/correlating-logs-to-single-spans/372813>\
**Category:** APM\
**Tags:** java\
**Created:** [January 5, 2025, 4:19pm UTC](https://discuss.elastic.co/t/correlating-logs-to-single-spans/372813 "2025-01-05T16:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ca-schue](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@ca-schue](https://discuss.elastic.co/u/ca-schue)\
**Post date:** [January 5, 2025, 4:19pm UTC](https://discuss.elastic.co/t/correlating-logs-to-single-spans/372813/1 "2025-01-05T16:19:09Z")

</div>

I'm currently playing around with manually instrumenting my java application. The application logs are already stored in elasticsearch.

I was hoping to find something like in Jaeger where the UI allows to view span events ("logs") per span and not per trace like in elastic apm:

 ![150103219-e9a052f2-0f57-4039-8c4b-f931a2f86300](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fefe251d03e9e88fad121cc2f978d4c70444a6ec.png)

When viewing a trace, I see that elastic apm allows categorizing the logs via service name. So is the only way of correlating logs to a span using the service name? Meaning, giving each span a pseudo service name which is referrenced in the corresponding log.
