Skip to content

Unable to output influxd.log. #822

@regenm

Description

@regenm

When I deploy influx:1.8 and 1.11 , I want to mount the log files(access.log and influxdb.log) to local directory. I tried many ways however in vain. But I did successfully output access.log and mount it. I am sure that the the problem is in the configration. Because I created a file(test.log) inside the contianer at /var/log/influxdb/ and I can see the test.log in my host machine.

And I did find a way to achieve this function but its not recommended:

  1. Get inside the container docker exec -it influxdb bash
  2. influxd > /var/log/influxdb/influxdb.log 2>&1 &
  3. After this operation , the influxdb.log is able to be accessed both in the container and host machine.

This is my deploy code:

deploy code

docker run -d \
  --name influxdb \
  -p 8086:8086 \
  -v /data/soft/influxdb1.8/data:/var/lib/influxdb \
  -v /data/soft/influxdb1.8/config/influxdb.conf:/etc/influxdb/influxdb.conf \
  -v /data/soft/influxdb1.8/log:/var/log/influxdb \
  influxdb:1.8 -config /etc/influxdb/influxdb.conf 

ways I tried

These are the ways I tried:

  1. change infuxdb.conf:
reporting-disabled = true   

[meta]
  dir = "/var/lib/influxdb/meta"   
  retention-autocreate = true
  logging-enabled = true

[data]
  dir = "/var/lib/influxdb/data"   
  wal-dir = "/var/lib/influxdb/wal" 
  query-log-enabled = true
  cache-max-memory-size = "1g"
  cache-snapshot-memory-size = "25m"
  cache-snapshot-write-cold-duration = "10m"
  compact-full-write-cold-duration = "4h"
  max-series-per-database = 1000000
  max-values-per-tag = 100000

[http]
  enabled = true
  bind-address = ":8086"         
  auth-enabled = false          
  log-enabled = true
  access-log-path = "/var/log/influxdb/access.log"

[logging]
  level = "info"                 
  file = "/var/log/influxdb/influxdb.log"

[retention]
  enabled = true
  check-interval = "30m"

  1. give all priviledges to the directories

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions