# Enable Log for tomcat APM Agent

**URL:** <https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867>\
**Category:** APM\
**Tags:** java\
**Created:** [May 22, 2020, 8:36am UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867 "2020-05-22T08:36:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhr/32/119834_2.png) [@mhr](https://discuss.elastic.co/u/mhr)\
**Post date:** [May 22, 2020, 8:36am UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867/1 "2020-05-22T08:36:09Z")

</div>

How to enable/Configure logs for APM Agent(Tomcat). I am using this.  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.log\_level=DEBUG"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.log\_file=/opt/elastic-apm/log.txt"

But files are not getting genrated

**Kibana version** :

**Elasticsearch version** :

**APM Server version** :

**APM Agent language and version** :

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

**Fresh install or upgraded from other version?**

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [May 24, 2020, 1:20pm UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867/2 "2020-05-24T13:20:53Z")

</div>

Your configuration seems right.

Which version of the agent are you using?

Please try out and report what you get:

- without configuring `log_file`
- with `-Delastic.apm.log_file= _AGENT_HOME_/log.txt"`

---

<div class="post-metadata">

**Author:** ![mhr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhr/32/119834_2.png) [@mhr](https://discuss.elastic.co/u/mhr)\
**Post date:** [May 26, 2020, 8:09am UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867/3 "2020-05-26T08:09:48Z")

</div>

export CATALINA\_OPTS="$CATALINA\_OPTS -javaagent:/opt/APM/elastic-apm-agent-1.16.0.jar"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.service\_name=sofware"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.application\_packages=com.package.test"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.server\_urls=http://ip:8200"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.log\_level=DEBUG"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.log\_file=/opt/APM/log.txt"

But log file is not getting generated.

---

<div class="post-metadata">

**Author:** ![mhr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhr/32/119834_2.png) [@mhr](https://discuss.elastic.co/u/mhr)\
**Post date:** [May 27, 2020, 3:01am UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867/4 "2020-05-27T03:01:47Z")

</div>

The Problem has been resolved. Now we can see the stats in Kibana APM. Upgraded Java Version and Agent Permission issue

---

<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:** [June 16, 2020, 11:01pm UTC](https://discuss.elastic.co/t/enable-log-for-tomcat-apm-agent/233867/5 "2020-06-16T23:01:47Z")

</div>

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