LoginSignup
1
1

More than 5 years have passed since last update.

MacでFluentdの環境構築

Posted at

環境情報

  • macOS Sierra 10.12.6
  • ruby 2.4.1

手順

# 作業ディレクトリに移動
$ cd {path_to_railsproject}

# fluentdをインストール
$ gem install fluentd

# 設定ファイルの作成(今回はroot/config/fluent配下に作成)
$ cd ./config
$ mkdir fluent
$ cd ./fluent/
$ fluentd --setup ./

# fluentdの起動
$ fluentd -c ./config/fluent/fluent.conf 

動作確認

# fluent-loggerを追加
$ gem install fluent-logger

# railsコンソールの起動
$ rails c

> Fluent::Logger::FluentLogger.open(nil, host: "localhost", port: 24224)
> Fluent::Logger::FluentLogger.post("debug.test", { "hoge" => "fuga" })

場合によってはこちらのgemを使うのが便利
act-fluent-logger-rails

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1