SlideShare une entreprise Scribd logo
1  sur  11
Javaアプリから
fluentd にログを送信する
    LoggerAppenderを
        作ってみた
Casual に    @tanaka_733

     fluentd Casual Talks 12/05/18
自己紹介@tanaka_733
• Cloud Foundry をいじってます
• Java / Node.js / Ruby など
• 趣味では Silverlight / Windows Phone /
  Metro style apps など
• ブログ: 銀の光と碧い空
  – フロントに無駄にnginx をおいたりしてる
分散/AutoScale環境のログ収集
分散/AutoScale環境のログ収集




落ちたインスタンスのログが失われてしまいま
すね
FLUENTD を使ってみる
Java アプリの場合
fluent logger javaを直接使う
• https://github.com/fluent/fluent-logger-java
• メリット
  – メッセージ形式を柔軟に指定可能

• デメリット
  – Loggerのインターフェースが揃わない
  – 既存のアプリだと改修がめんどい
LoggerAppender作りました
• ログ出力は今まで通り                  Casual に
• 設定ファイルに追加するだけ
• https://github.com/tanaka-takayoshi/fluentd-
 logback-appender
• https://github.com/tanaka-takayoshi/fluentd-
 log4j-appender
対応Logライブラリ
• log4j
  – 昔からの定番
  – 最近Updateされていない

• slf4j (API) + logback (実装)
  – log4j の後継
  – ログ実装をjarの入れ替えで切り替え可能
  – おすすめ
Casual な デモ
課題
• tagとlabelを動的に指定する方法
 – logbackならMDC(ログのメタデータ)
  を使うのがいいかなと
• JSON形式の指定
 – XMLだと設定ファイルだけですむ
   • でもJSONの指定が面倒そう

 – Encoder + Layoutクラスを用意する?
   • 指定するのに継承したクラスを用意しないといけない

Contenu connexe

Similaire à 120518 fluentd javalogger

Hatena blogdevelopmentflow
Hatena blogdevelopmentflowHatena blogdevelopmentflow
Hatena blogdevelopmentflowYasuhiro Onishi
 
最近作ったもの
最近作ったもの最近作ったもの
最近作ったものonozaty
 
DLR言語によるSilverlightプログラミング
DLR言語によるSilverlightプログラミングDLR言語によるSilverlightプログラミング
DLR言語によるSilverlightプログラミングterurou
 
Yet Another DLR for Silverlightの試作
Yet Another DLR for Silverlightの試作Yet Another DLR for Silverlightの試作
Yet Another DLR for Silverlightの試作terurou
 
Vagrant & Dockerによるイマドキの開発環境構築
Vagrant & Dockerによるイマドキの開発環境構築Vagrant & Dockerによるイマドキの開発環境構築
Vagrant & Dockerによるイマドキの開発環境構築Nakazawa Yuichi
 
20180616 to takepartflow
20180616 to takepartflow20180616 to takepartflow
20180616 to takepartflowTomoyuki Obi
 
Rails解説セミナー: Rails国際化 (I18n) API
Rails解説セミナー: Rails国際化 (I18n) APIRails解説セミナー: Rails国際化 (I18n) API
Rails解説セミナー: Rails国際化 (I18n) APIYohei Yasukawa
 
ALMツールたべくらべ
ALMツールたべくらべALMツールたべくらべ
ALMツールたべくらべKaoru NAKAMURA
 
Device Farm を使ったスマホアプリの自動テスト
Device Farm を使ったスマホアプリの自動テストDevice Farm を使ったスマホアプリの自動テスト
Device Farm を使ったスマホアプリの自動テスト健一 辰濱
 
Firefox mobile for android internals
Firefox mobile for android internalsFirefox mobile for android internals
Firefox mobile for android internalsMakoto Kato
 
Nodeにしましょう
NodeにしましょうNodeにしましょう
NodeにしましょうYuzo Hebishima
 
Webサーバ勉強会 LT資料
Webサーバ勉強会 LT資料Webサーバ勉強会 LT資料
Webサーバ勉強会 LT資料学 松崎
 
Fluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitFluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitSeiya Mizuno
 
Sledge recently in Yokohama.pm Aug, 2008
Sledge recently in Yokohama.pm Aug, 2008Sledge recently in Yokohama.pm Aug, 2008
Sledge recently in Yokohama.pm Aug, 2008Yoshiki Kurihara
 
たのしいNode.js
たのしいNode.jsたのしいNode.js
たのしいNode.jsishiki-takai
 
多分モダンなWebアプリ開発
多分モダンなWebアプリ開発多分モダンなWebアプリ開発
多分モダンなWebアプリ開発tak-nakamura
 
DartPad+CodePenで、Flutterを体験してみよう
DartPad+CodePenで、Flutterを体験してみようDartPad+CodePenで、Flutterを体験してみよう
DartPad+CodePenで、Flutterを体験してみようcch-robo
 

Similaire à 120518 fluentd javalogger (20)

Hatena blogdevelopmentflow
Hatena blogdevelopmentflowHatena blogdevelopmentflow
Hatena blogdevelopmentflow
 
最近作ったもの
最近作ったもの最近作ったもの
最近作ったもの
 
DLR言語によるSilverlightプログラミング
DLR言語によるSilverlightプログラミングDLR言語によるSilverlightプログラミング
DLR言語によるSilverlightプログラミング
 
Yet Another DLR for Silverlightの試作
Yet Another DLR for Silverlightの試作Yet Another DLR for Silverlightの試作
Yet Another DLR for Silverlightの試作
 
Vagrant & Dockerによるイマドキの開発環境構築
Vagrant & Dockerによるイマドキの開発環境構築Vagrant & Dockerによるイマドキの開発環境構築
Vagrant & Dockerによるイマドキの開発環境構築
 
20180616 to takepartflow
20180616 to takepartflow20180616 to takepartflow
20180616 to takepartflow
 
Rails解説セミナー: Rails国際化 (I18n) API
Rails解説セミナー: Rails国際化 (I18n) APIRails解説セミナー: Rails国際化 (I18n) API
Rails解説セミナー: Rails国際化 (I18n) API
 
ALMツールたべくらべ
ALMツールたべくらべALMツールたべくらべ
ALMツールたべくらべ
 
Device Farm を使ったスマホアプリの自動テスト
Device Farm を使ったスマホアプリの自動テストDevice Farm を使ったスマホアプリの自動テスト
Device Farm を使ったスマホアプリの自動テスト
 
Firefox mobile for android internals
Firefox mobile for android internalsFirefox mobile for android internals
Firefox mobile for android internals
 
Start-padrino
Start-padrinoStart-padrino
Start-padrino
 
Nodeにしましょう
NodeにしましょうNodeにしましょう
Nodeにしましょう
 
Webサーバ勉強会 LT資料
Webサーバ勉強会 LT資料Webサーバ勉強会 LT資料
Webサーバ勉強会 LT資料
 
Fluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitFluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent Bit
 
Sledge recently in Yokohama.pm Aug, 2008
Sledge recently in Yokohama.pm Aug, 2008Sledge recently in Yokohama.pm Aug, 2008
Sledge recently in Yokohama.pm Aug, 2008
 
SPA×Auth0
SPA×Auth0SPA×Auth0
SPA×Auth0
 
たのしいNode.js
たのしいNode.jsたのしいNode.js
たのしいNode.js
 
appengine活用事例資料@TDDBC札幌2.1
appengine活用事例資料@TDDBC札幌2.1appengine活用事例資料@TDDBC札幌2.1
appengine活用事例資料@TDDBC札幌2.1
 
多分モダンなWebアプリ開発
多分モダンなWebアプリ開発多分モダンなWebアプリ開発
多分モダンなWebアプリ開発
 
DartPad+CodePenで、Flutterを体験してみよう
DartPad+CodePenで、Flutterを体験してみようDartPad+CodePenで、Flutterを体験してみよう
DartPad+CodePenで、Flutterを体験してみよう
 

Plus de Takayoshi Tanaka

deep dive distributed tracing
deep dive distributed tracingdeep dive distributed tracing
deep dive distributed tracingTakayoshi Tanaka
 
202202 open telemetry .net handson
202202 open telemetry .net handson202202 open telemetry .net handson
202202 open telemetry .net handsonTakayoshi Tanaka
 
202109-New_Relic-for-csharp-engineers
202109-New_Relic-for-csharp-engineers202109-New_Relic-for-csharp-engineers
202109-New_Relic-for-csharp-engineersTakayoshi Tanaka
 
20210129 azure webapplogging
20210129 azure webapplogging20210129 azure webapplogging
20210129 azure webapploggingTakayoshi Tanaka
 
SRENEXT 2020 [B5] New RelicのSREに学ぶ SREのためのNew Relic活用法
SRENEXT 2020 [B5] New RelicのSREに学ぶSREのためのNew Relic活用法SRENEXT 2020 [B5] New RelicのSREに学ぶSREのためのNew Relic活用法
SRENEXT 2020 [B5] New RelicのSREに学ぶ SREのためのNew Relic活用法Takayoshi Tanaka
 
20191024 Get Start gRPC with ASP.NET
20191024 Get Start gRPC with ASP.NET20191024 Get Start gRPC with ASP.NET
20191024 Get Start gRPC with ASP.NETTakayoshi Tanaka
 
New Relicで始める、.NET Applications on AWSのObservability
New Relicで始める、.NET Applications on AWSのObservabilityNew Relicで始める、.NET Applications on AWSのObservability
New Relicで始める、.NET Applications on AWSのObservabilityTakayoshi Tanaka
 
C#エンジニアのためのdocker kubernetesハンズオン (再)
C#エンジニアのためのdocker kubernetesハンズオン (再)C#エンジニアのためのdocker kubernetesハンズオン (再)
C#エンジニアのためのdocker kubernetesハンズオン (再)Takayoshi Tanaka
 
C#エンジニアのためのdocker kubernetesハンズオン
C#エンジニアのためのdocker kubernetesハンズオンC#エンジニアのためのdocker kubernetesハンズオン
C#エンジニアのためのdocker kubernetesハンズオンTakayoshi Tanaka
 
20190604 Containerized MagicOnion on kubernetes with Observability with New R...
20190604 Containerized MagicOnion on kubernetes with Observability with New R...20190604 Containerized MagicOnion on kubernetes with Observability with New R...
20190604 Containerized MagicOnion on kubernetes with Observability with New R...Takayoshi Tanaka
 
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能Takayoshi Tanaka
 
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能Takayoshi Tanaka
 
Try! Visual Studio 209 git feature
Try! Visual Studio 209 git featureTry! Visual Studio 209 git feature
Try! Visual Studio 209 git featureTakayoshi Tanaka
 
(過去バージョン) Q#基礎 ver1.0
(過去バージョン) Q#基礎 ver1.0(過去バージョン) Q#基礎 ver1.0
(過去バージョン) Q#基礎 ver1.0Takayoshi Tanaka
 

Plus de Takayoshi Tanaka (20)

deep dive distributed tracing
deep dive distributed tracingdeep dive distributed tracing
deep dive distributed tracing
 
202202 open telemetry .net handson
202202 open telemetry .net handson202202 open telemetry .net handson
202202 open telemetry .net handson
 
202109-New_Relic-for-csharp-engineers
202109-New_Relic-for-csharp-engineers202109-New_Relic-for-csharp-engineers
202109-New_Relic-for-csharp-engineers
 
20210129 azure webapplogging
20210129 azure webapplogging20210129 azure webapplogging
20210129 azure webapplogging
 
20201127 .NET 5
20201127 .NET 520201127 .NET 5
20201127 .NET 5
 
Unity(再)入門
Unity(再)入門Unity(再)入門
Unity(再)入門
 
最近のQ#について
最近のQ#について最近のQ#について
最近のQ#について
 
SRENEXT 2020 [B5] New RelicのSREに学ぶ SREのためのNew Relic活用法
SRENEXT 2020 [B5] New RelicのSREに学ぶSREのためのNew Relic活用法SRENEXT 2020 [B5] New RelicのSREに学ぶSREのためのNew Relic活用法
SRENEXT 2020 [B5] New RelicのSREに学ぶ SREのためのNew Relic活用法
 
20191024 Get Start gRPC with ASP.NET
20191024 Get Start gRPC with ASP.NET20191024 Get Start gRPC with ASP.NET
20191024 Get Start gRPC with ASP.NET
 
New Relicで始める、.NET Applications on AWSのObservability
New Relicで始める、.NET Applications on AWSのObservabilityNew Relicで始める、.NET Applications on AWSのObservability
New Relicで始める、.NET Applications on AWSのObservability
 
C#エンジニアのためのdocker kubernetesハンズオン (再)
C#エンジニアのためのdocker kubernetesハンズオン (再)C#エンジニアのためのdocker kubernetesハンズオン (再)
C#エンジニアのためのdocker kubernetesハンズオン (再)
 
20190806 Q# Measurements
20190806 Q# Measurements20190806 Q# Measurements
20190806 Q# Measurements
 
C#エンジニアのためのdocker kubernetesハンズオン
C#エンジニアのためのdocker kubernetesハンズオンC#エンジニアのためのdocker kubernetesハンズオン
C#エンジニアのためのdocker kubernetesハンズオン
 
20190604 Containerized MagicOnion on kubernetes with Observability with New R...
20190604 Containerized MagicOnion on kubernetes with Observability with New R...20190604 Containerized MagicOnion on kubernetes with Observability with New R...
20190604 Containerized MagicOnion on kubernetes with Observability with New R...
 
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studio 2019の機能
 
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能
.NET Core向けコンテナおよびデバッグ関連のVisual Studioの新機能
 
Try! Visual Studio 209 git feature
Try! Visual Studio 209 git featureTry! Visual Studio 209 git feature
Try! Visual Studio 209 git feature
 
Q#基礎 ver1.1
Q#基礎 ver1.1Q#基礎 ver1.1
Q#基礎 ver1.1
 
(過去バージョン) Q#基礎 ver1.0
(過去バージョン) Q#基礎 ver1.0(過去バージョン) Q#基礎 ver1.0
(過去バージョン) Q#基礎 ver1.0
 
ゼロから始めるQ#
ゼロから始めるQ#ゼロから始めるQ#
ゼロから始めるQ#
 

Dernier

論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 

Dernier (10)

論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 

120518 fluentd javalogger