2
votes

I've been using the EFK stack (Elasticsearch, Fluentd, Kibana) to centralize my dockerized apps logs in elasticsearch (http://docs.fluentd.org/v0.12/articles/docker-logging-efk-compose)

But at the same time I want to display the logs in stdout...

At the moment, when I run the docker containers with logging driver of fluentd I cant see the logs in stdout. Anyoune knows how to enable the logs in stdout and fluentd at the same time...?

the fluetnd.conf file is as following:

<source>
  @type forward
  port 24224
  bind 0.0.0.0
</source>

<match alert.**>
  @type copy
  <store>
    @type elasticsearch
    host elasticsearch
    port 9200
    logstash_format true
    logstash_prefix alert
    logstash_dateformat %Y%m%d
    type_name access_log
    tag_key @log_name
    flush_interval 1s
  </store>
  <store>
    @type stdout
  </store>
</match>

<match measurements.**>
  @type copy
  <store>
    @type elasticsearch
    host elasticsearch
    port 9200
    logstash_format true
    logstash_prefix measurements
    logstash_dateformat %Y%m%d
    type_name access_log
    tag_key @log_name
    flush_interval 1s
  </store>
  <store>
    @type stdout
  </store>
</match>


<match *.**>
  @type copy
  <store>
    @type elasticsearch
    host elasticsearch
    port 9200
    logstash_format true
    logstash_prefix fluentd
    logstash_dateformat %Y%m%d
    include_tag_key true
    type_name access_log
    tag_key @log_name
    flush_interval 1s
  </store>
  <store>
    @type stdout
  </store>
</match>
1

1 Answers

1
votes

There are only two docker logging drivers that support the "docker logs" interface: json and journald.

The best workaround to be able to see your logs in the "docker logs" command, and in another driver is currently to use either the json or journald driver, and then set up forwarding to your final logging store.