fluent - Log management on Docker -
i want send stdout log docker container fluentd. but, when 1 container outputs access logs , error logs, logs mixed.
example
# rails access log 2017-04-07 12:10:01 +0000 6a51e389e724: {"log":"i, [2017-04-07t12:10:01.825923 #7] info -- : started \"/users/new\" 172.21.0.1 @ 2017-04-07 12:10:01 +0000","container_id":"6a51e389e724c67be4e714402b69da192db4a304cbfdf638594de6cff9774c23","container_name":"/app","source":"stdout"} # rails error log 2017-04-07 12:10:01 +0000 6a51e389e724: {"container_id":"6a51e389e724c67be4e714402b69da192db4a304cbfdf638594de6cff9774c23","container_name":"/app","source":"stdout","log":"e, [2017-04-07t12:10:01.830039 #7] error -- : invoke logger error"} # rails access log 2017-04-07 12:10:03 +0000 6a51e389e724: {"log":"i, [2017-04-07t12:10:01.825923 #7] info -- : started post \"/users/create\" 172.21.0.1 @ 2017-04-07 12:10:01 +0000","container_id":"6a51e389e724c67be4e714402b69da192db4a304cbfdf638594de6cff9774c23","container_name":"/app","source":"stdout"}
can add label each log type? please tell me if have solution.
thanks , best regards.
as app's access , error logs sent stdout of container, have no way separate them logging driver. solution can send access log stdout, error log stderr of container, later differentiate logs "source" field of each json message (this can done if connect fluentd elasticsearch+kibana).
Comments
Post a Comment