# Module/apmzap

**URL:** https://discuss.elastic.co/t/module-apmzap/296154
**Category:** APM
**Tags:** docker, go
**Created:** [February 3, 2022, 8:12am UTC](https://discuss.elastic.co/t/module-apmzap/296154 "2022-02-03T08:12:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MerNat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mernat/32/101286_2.png) [@MerNat](https://discuss.elastic.co/u/MerNat)
#### Post date: [February 3, 2022, 8:12am UTC](https://discuss.elastic.co/t/module-apmzap/296154/1 "2022-02-03T08:12:50Z")

</div>

I'm trying to send logs to the APM server and thus can see it in transactions associated logs. I've simply followed the simple doc [Built-in instrumentation modules | APM Go Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/go/current/builtin-modules.html#builtin-modules-apmzap).

**Kibana version** : 7.13

**Elasticsearch version** : 7.13

**APM Server version** : 7.13

**APM Agent language and version** : module/apmzap

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

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

**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. No, just a minimal docker-compose-based APM server.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: I'm only seeing that logging out is only available in the terminal (stdout). I believe it is supposed to be also available on the APM server, thus not getting it in the server.

This is my simple env config:

```auto
ELASTIC_APM_LOG_FILE=stderr=stdout
ELASTIC_APM_LOG_LEVEL=debug
ELASTIC_APM_SERVICE_NAME=my-new-service
ELASTIC_APM_SERVER_URL=http://localhost:8200

```

**Steps to reproduce** :

1. I've used the simple example provided herein the doc: [https://github.com/elastic/apm-agent-go/edit/1.x/docs/instrumenting.asciidoc](https://github.com/elastic/apm-agent-go/edit/1.x/docs/instrumenting.asciidoc)

**Provide logs and/or server output (if relevant)**:  
Output is basically to the stdout terminal but not the APM server:

```auto
{"level":"info","msg":"handling request","trace.id":"328d53d8a1d43dfee988e191d2ea2792","transaction.id":"328d53d8a1d43dfe"}
{"level":"error","msg":"handling error","trace.id":"328d53d8a1d43dfee988e191d2ea2792","transaction.id":"328d53d8a1d43dfe"

```

---

<div class="post-metadata">

### Author: ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)
#### Post date: [February 4, 2022, 6:06am UTC](https://discuss.elastic.co/t/module-apmzap/296154/2 "2022-02-04T06:06:09Z")

</div>

Welcome to the forum @MerNat!

In case it's unclear, `apmzap` is not intended for sending _all_ logs to APM Server, only error logs. Having said that, you have shown error logs in the output above; that one should be sent to the server.

Can you please provide the agent logs? Above you said you've configured `ELASTIC_APM_LOG_FILE=stderr=stdout`; it should be just `ELASTIC_APM_LOG_FILE=stderr` (or `=stdout`). They may give a clue as to why the error events aren't being sent to the server.

---

<div class="post-metadata">

### Author: ![MerNat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mernat/32/101286_2.png) [@MerNat](https://discuss.elastic.co/u/MerNat)
#### Post date: [February 4, 2022, 9:08am UTC](https://discuss.elastic.co/t/module-apmzap/296154/3 "2022-02-04T09:08:17Z")

</div>

Thank you for your reply and help @axw 🙂

Actually, I'm getting the error log now after I removed `ELASTIC_APM_SERVER_URL=http://localhost:8200`.

---

<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: [February 25, 2022, 5:09am UTC](https://discuss.elastic.co/t/module-apmzap/296154/4 "2022-02-25T05:09:07Z")

</div>

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