# Help with instrumenting an application on Tomcat 5.x

**URL:** <https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687>\
**Category:** APM\
**Created:** [August 23, 2018, 9:05am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687 "2018-08-23T09:05:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandhya\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Sandhya\_Agarwal](https://discuss.elastic.co/u/Sandhya_Agarwal)\
**Post date:** [August 23, 2018, 9:05am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/1 "2018-08-23T09:05:13Z")

</div>

Hello,

I have been able to successfully instrument my application, which is running on Tomcat 5.x. I am able to see the event logs in APM agent logs. However, the logs are not being sent to the APM server and do not show up in the Kibana dashboards. I understand 5.x is not supported. But, I would like to understand what changes are required to support 5.x.

Thank you,  
Sandhya

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 23, 2018, 12:09pm UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/2 "2018-08-23T12:09:57Z")

</div>

> [@Sandhya\_Agarwal](#):
>
> However, the logs are not being sent to the APM server and do not show up in the Kibana dashboards

To be sure I understand you correctly - do you want to analyze the agent log file in Kibana? The agent does not send any logs to the APM server. It sends transaction and span events.

Could you attach the full agent `DEBUG` log file?

---

<div class="post-metadata">

**Author:** ![Sandhya\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Sandhya\_Agarwal](https://discuss.elastic.co/u/Sandhya_Agarwal)\
**Post date:** [August 23, 2018, 12:50pm UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/3 "2018-08-23T12:50:56Z")

</div>

Thank you for the response.

I meant the transactions and span events.

However, when I enabled my application to run on Tomcat 7.x, I do see the events being transported to the APM server. I understand Tomcat 5.x is not supported and hence the events were not being reported.

On another note, is it possible to capture the user information OOTB. And also the method parameters etc;

Thank you,  
Sandhya

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 23, 2018, 3:08pm UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/4 "2018-08-23T15:08:26Z")

</div>

> [@Sandhya\_Agarwal](#):
>
> On another note, is it possible to capture the user information OOTB.

Which framework are you using for user-management? The agent reads user information from `javax.servlet.http.HttpServletRequest#getUserPrincipal`.

> [@Sandhya\_Agarwal](#):
>
> And also the method parameters etc;

The agent does not record each method invocation and thus also does not record all parameters. You could, however, create a [custom span](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-start-span) for methods you are interested in.

Do you want to give a bit more context about your use-case and what you are trying to achieve?

---

<div class="post-metadata">

**Author:** ![Sandhya\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Sandhya\_Agarwal](https://discuss.elastic.co/u/Sandhya_Agarwal)\
**Post date:** [August 24, 2018, 5:47am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/5 "2018-08-24T05:47:24Z")

</div>

I was looking at the stack trace and it shows the code path and method and classes that are being invoked. So, was wondering if the method parameters can be captured too ?

Along with performance metrics, I was wondering if I could capture the data submitted by the user for a certain action.

Also, I see that some of the DB SQL queries are truncated. Do we have a max size limit on the queries.

I am sorry about including too many questions in one topic. If you'd like, I can open a separate topic for some other questions I have. Thank you.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 24, 2018, 6:33am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/6 "2018-08-24T06:33:18Z")

</div>

That's perfectly fine, ask all the questions you want 🙂

> [@Sandhya\_Agarwal](#):
>
> I was looking at the stack trace and it shows the code path and method and classes that are being invoked. So, was wondering if the method parameters can be captured too ?

While that is working for other agents, in Java it's unfortunately not trivial as you can't just read the parameters from a `StackTraceElement`.

> [@Sandhya\_Agarwal](#):
>
> Along with performance metrics, I was wondering if I could capture the data submitted by the user for a certain action.

You can capture `application/x-www-form-urlencoded` (form parameters) by enabling [capture\_body](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-capture-body)

> [@Sandhya\_Agarwal](#):
>
> Also, I see that some of the DB SQL queries are truncated. Do we have a max size limit on the queries.

Good catch, currently all Strings are limited to 1024 characters, but for SQL statements, there should actually not be a limit. I'll remove the limit so you can see your full SQL.

---

<div class="post-metadata">

**Author:** ![Sandhya\_Agarwal](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Sandhya\_Agarwal](https://discuss.elastic.co/u/Sandhya_Agarwal)\
**Post date:** [August 24, 2018, 6:35am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/7 "2018-08-24T06:35:51Z")

</div>

That helps. Thank you so much.

---

<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:** [September 14, 2018, 2:35am UTC](https://discuss.elastic.co/t/help-with-instrumenting-an-application-on-tomcat-5-x/145687/8 "2018-09-14T02:35:54Z")

</div>

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