Configure Unified Logging Using Fluentd
For information and steps on installing Fluentd, refer to Fluentd's installation documentation. If Fluentd is not installed on the same server as the Composer, you will need to obtain the host and port numbers for the Fluentd server.
This section provides describes how to configure Fluentd to log Composer log data.
Configure Fluentd for logging Composer log data:
Run the following command on the server where Composer is installed to install
td-agenton that server.
curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh
Browse to the
/etcfolder on the Composer server to verify that
td-agentis installed in the
Install the Fluentd plugin for the data store you are using to store your Fluentd logs. Refer to your Fluentd documentation for more information.
For example, if you are using an Elasticsearch database to store Fluentd logs. run the following command to install the Fluentd Elasticsearch plugin on the Composer server.
sudo td-agent-gem install fluent-plugin-elasticsearch
The following is an example of
td-agent.confusing an Elasticsearch database for Fluentd logs.
@type forward port <fluentd_port> bind 0.0.0.0 </source> <match *.**> @type copy <store> @type elasticsearch host <elasticsearch_host> port <elasticsearch_port> user <elasticsearch-user> password <elasticsearch-password> logstash_format true logstash_prefix composer-unified-log logstash_dateformat %Y%m%d include_tag_key true index_name composer-unified-log type_name composer-unified-log tag_key @log_name flush_interval 1s </store> <store> @type stdout </store> </match>
systemctl restart td-agent
Complete the steps described inEnable Unified Logging in Composer v6 Using Fluentd to enable Fluentd logging by Composer.