# Metricbeat - Not creating any logfile

**URL:** <https://discuss.elastic.co/t/metricbeat-not-creating-any-logfile/295266>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 24, 2022, 5:59pm UTC](https://discuss.elastic.co/t/metricbeat-not-creating-any-logfile/295266 "2022-01-24T17:59:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujeetkp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sujeetkp/32/100806_2.png) [@sujeetkp](https://discuss.elastic.co/u/sujeetkp)\
**Post date:** [January 24, 2022, 5:59pm UTC](https://discuss.elastic.co/t/metricbeat-not-creating-any-logfile/295266/1 "2022-01-24T17:59:19Z")

</div>

I am trying to set up metric beat for my CentOS7 host. I have explictly mentioned the logfile location for the metricbeat and the logging level is debug, but I dont see a log file created. I can see the logs in journalctl. Please let me know why the logfile is not creating. Same setting works with filebeat and the log file gets created.

```auto
root@example.domain.com:/usr/share/metricbeat# metricbeat version
metricbeat version 7.2.0 (amd64), libbeat 7.2.0 [9ba65d864ca37cd32c25b980dbb4020975288fc0 built 2019-06-20 15:07:31 +0000 UTC]

```

**Metricbeat config file:** /etc/metricbeat/metricbeat.yml

```auto
metricbeat:
  config:
    modules:
      path: /etc/metricbeat/modules.d/*.yml
      reload.enabled: true
      reload.period: 10s

output.logstash:
  hosts: ['logstash.domain.com:5158']
  worker: 1
  compression_level: 3
  loadbalance: true
  ssl:
    certificate: /usr/share/metricbeat/metricbeat.crt
    key: /usr/share/metricbeat/metricbeat.key
    verification_mode: none

logging:
  level: debug
  to_files: true
  files:
    path: /var/myapp/log/metricbeat
    name: metricbeat.log
    rotateeverybytes: 10485760
    keepfiles: 7

```

Ideally it should create a file (metricbeat.log) in /var/myapp/log/metricbeat location, but I dont see any files getting created.

**Journalctl output:**

```auto
* metricbeat.service - Metricbeat is a lightweight shipper for metrics.
   Loaded: loaded (/usr/lib/systemd/system/metricbeat.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-01-24 08:51:13 PST; 39min ago
     Docs: https://www.elastic.co/products/beats/metricbeat
 Main PID: 13520 (metricbeat)
   CGroup: /system.slice/metricbeat.service
           `-13520 /usr/share/metricbeat/bin/metricbeat -e -c /etc/metricbeat/metricbeat.yml -path.home /usr/share/metricbeat -path.config /etc/metricbeat -path.data /var/lib/metricbeat -path.logs /var/log/metricbeat

Jan 24 09:30:14 example.domain.com metricbeat[13520]: "/var/lib/metricbeat",
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "-path.logs",
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "/var/log/metricbeat"
Jan 24 09:30:14 example.domain.com metricbeat[13520]: ]
Jan 24 09:30:14 example.domain.com metricbeat[13520]: },
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "user": {
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "name": "root"
Jan 24 09:30:14 example.domain.com metricbeat[13520]: },
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "event": {
Jan 24 09:30:14 example.domain.com metricbeat[13520]: "module": "system",

```

I dont see any thing in "/var/log/metricbeat" directory as well.

EDIT: I tried with version 6.3 and 7.16. It works fine. Looks like some issue with 7.2

---

<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 21, 2022, 7:59pm UTC](https://discuss.elastic.co/t/metricbeat-not-creating-any-logfile/295266/2 "2022-02-21T19:59:41Z")

</div>

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