# Heartbeat not writing to log file

**URL:** <https://discuss.elastic.co/t/heartbeat-not-writing-to-log-file/213213>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [December 27, 2019, 5:09pm UTC](https://discuss.elastic.co/t/heartbeat-not-writing-to-log-file/213213 "2019-12-27T17:09:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yodog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yodog/32/4822_2.png) [@yodog](https://discuss.elastic.co/u/yodog)\
**Post date:** [December 27, 2019, 5:09pm UTC](https://discuss.elastic.co/t/heartbeat-not-writing-to-log-file/213213/1 "2019-12-27T17:09:44Z")

</div>

heartbeat is not writing to log file.

i know it is loging to journal, because this works:

`journalctl -u heartbeat-elastic`

```
Dez 27 14:04:15 elastic-zmb-01 systemd[1]: Started Ping remote services for availability and log results to Elasticsearch or send to Logstash..

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.958-0300 INFO instance/beat.go:610 Home path: [/usr/share/heartbeat] Config path: [/etc/heartbeat] Data path: [/var/lib/heartbeat] Logs path: [/var/log/heartbeat]

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.959-0300 INFO instance/beat.go:618 Beat ID: 6cd8e62f-d182-4296-a15c-87543c183f60

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.965-0300 INFO [api] api/server.go:62 Starting stats endpoint

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.965-0300 INFO [seccomp] seccomp/seccomp.go:124 Syscall filter successfully installed

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.965-0300 INFO [beat] instance/beat.go:941 Beat info {"system_info": {"beat": {"path": {"config": "/etc/heartbeat", "data": "/var/lib/heartbeat", "home": "/usr/share/heartbeat", "logs": "/var/log/heartbeat"}, "type": "heartbeat", "uuid": "6cd8e62f-d182-4296-a15c-87543c183f60"}}}

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.965-0300 INFO [beat] instance/beat.go:950 Build info {"system_info": {"build": {"commit": "60dd883ca29e1fdd5b8b075bd5f3698948b1d44d", "libbeat": "7.5.1", "time": "2019-12-16T21:29:47.000Z", "version": "7.5.1"}}}

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.965-0300 INFO [api] api/server.go:64 Metrics endpoint listening on: 127.0.0.1:5066 (configured: localhost)

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.966-0300 INFO [beat] instance/beat.go:953 Go runtime info {"system_info": {"go": {"os":"linux","arch":"amd64","max_procs":20,"version":"go1.12.12"}}}

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.969-0300 INFO instance/beat.go:297 Setup Beat: heartbeat; Version: 7.5.1

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.969-0300 INFO [index-management] idxmgmt/std.go:182 Set output.elasticsearch.index to 'heartbeat-7.5.1' as ILM is enabled.

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.970-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-01:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.970-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-02:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.970-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-03:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.970-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-04:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.970-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-05:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.971-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-06:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.971-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-07:9200

Dez 27 14:04:15 elastic-zmb-01 heartbeat[107392]: 2019-12-27T14:04:15.971-0300 INFO elasticsearch/client.go:171 Elasticsearch url: http://elastic-zmb-08:9200

```

even if i manually create `/var/log/heartbeat/heartbeat` it never writes to this file.

this is my config:

```
heartbeat.config.monitors:
  path: ${path.config}/monitors.d/*.yml
  reload.enabled: true
  reload.period: 1m

processors:
- add_host_metadata:
    netinfo.enabled: true
- add_locale:
    format: offset
- add_process_metadata:
    match_pids: ["system.process.ppid"]
    target: system.process.parent

heartbeat.monitors:
- type: tcp
  schedule: '@every 10s'
  hosts: localhost
  ipv4: true
  mode: any
  ports: [80, 5044, 5066, 9200]
  timeout: 5s

monitoring.enabled: true

http: { enabled: true, port: 5066 }

setup.kibana:
  host: "elastic-zmb-pool"

output.elasticsearch:
  compression_level: 5
  hosts: ["elastic-zmb-01", "elastic-zmb-02", "elastic-zmb-03", "elastic-zmb-04", "elastic-zmb-05", "elastic-zmb-06", "elastic-zmb-07", "elastic-zmb-08"]
  loadbalance: true

monitoring.elasticsearch: ${output.elasticsearch}

logging:
  files: { path: /var/log/heartbeat, name: heartbeat, keepfiles: 2, permissions: 0664, redirect_stderr: true }
  level: info
  metrics: { enabled: true, period: 1m }
  to_files: true
  to_syslog: false
```

---

<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:** [January 24, 2020, 5:09pm UTC](https://discuss.elastic.co/t/heartbeat-not-writing-to-log-file/213213/2 "2020-01-24T17:09:45Z")

</div>

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