Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
#渋谷java - Logback の Appender を実装してみよう
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
KOMIYA Atsushi
December 13, 2014
Programming
1
2.4k
#渋谷java - Logback の Appender を実装してみよう
第九回 渋谷 Java の飛び入り LT で発表した資料です。
http://shibuya-java.connpass.com/event/9996/
KOMIYA Atsushi
December 13, 2014
Tweet
Share
More Decks by KOMIYA Atsushi
See All by KOMIYA Atsushi
#JJUG Java における乱数生成器とのつき合い方
komiya_atsushi
5
5.5k
#JJUG Fork/Join フレームワークを効率的に正しく使いたい
komiya_atsushi
0
550
[#JSUG] SmartNews における container friendly な Spring Boot アプリケーション開発
komiya_atsushi
1
11k
Java のデータ圧縮ライブラリを極める #jjug_ccc #ccc_c7
komiya_atsushi
4
5.2k
#devsumi 自然言語処理・機械学習によるファクトチェック業務の支援
komiya_atsushi
1
4.7k
SmartNews Ads における機械学習の活用とその運用 #mlops
komiya_atsushi
3
20k
GBDT によるクリック率予測を高速化したい #オレシカナイト vol.4
komiya_atsushi
5
1.4k
Maven central repository の artifact をランキングする #渋谷java
komiya_atsushi
0
1.5k
確率的データ構造を Java で扱いたい! #JJUG
komiya_atsushi
6
2.4k
Other Decks in Programming
See All in Programming
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
680
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
AI & Enginnering
codelynx
0
110
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
CSC307 Lecture 06
javiergs
PRO
0
680
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
150
SourceGeneratorのススメ
htkym
0
190
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
460
AgentCoreとHuman in the Loop
har1101
5
220
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Statistics for Hackers
jakevdp
799
230k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Building AI with AI
inesmontani
PRO
1
670
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
400
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
270
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Unsuck your backbone
ammeep
671
58k
Transcript
Logback ͷ Appender Λ ࣮ͯ͠ΈΑ͏ ୈճ #ौ୩java 2014-12-13 at BizReach
@komiya_atsushi
͓·ͩΕ
,0.*:""UTVTIJ !LPNJZB@BUTVTIJ
None
None
ʮੈքதͷྑ࣭ͳใΛඞཁͳਓʹૹΓಧ͚Δʯ ͨΊʹɺौ୩ɾࡩٰொͰ ʑδϟόδϟό͍ͯ͠·͢
None
None
ͦ͏͍͏Θ͚Ͱ
ΈΜͳ͍͖ͩ͢ Logback ͷ Appender Λ࣮ͯ͠Έ·͠ΐ͏
None
—
IUUQRJJUBDPNNBDIJUFNTB⒎DBBDBD
ࣾͷใڞ༗ͷେ Slack ্
αʔόͷҟৗঢ়ଶΛ௨͢Δ ઌવ Slack
Java ΞϓϦέʔγϣϯͷ ࣮ߦதʹҟৗ͕ੜͨ͡ͱ͖ɺ Slack ͰѲ͍ͨ͠ʂ
Logback ܦ༝Ͱ Slack ʹ ϝοηʔδΛϙετ͍ͨ͠ʂ
How to
1. Slack API Λୟͨ͘Ίͷ τʔΫϯΛऔಘ͢Δ
http://qiita.com/punchdrunker/items/db9c824397e3affbb210
͖͞΄Ͳ·Ͱ ͭ·͍ͮͯ·ͨ͠ (>_<)
2. Appender Λ࣮͢Δ
جఈΫϥεΛ͍·͠ΐ͏ • AppenderBase<ILoggingEvent> • ࠓճͪ͜ΒΛͬͯΈͨ • UnsynchronizedAppenderBase <ILoggingEvent>
• ͨͿΜͪ͜ΒΛ͏͖
HTTP(S) ௨৴͢ΔॲཧඇಉظͰ • HTTP(S) ͰϦΫΤετΛ͛Δͷ͕͔͔࣌ؒΔ… • Appender ͰεϨουΛ্ཱͪ͛ͯɺϩάΠϕϯτ ΛΩϡʔܦ༝ͰϝΠϯεϨου͔Βڙڅͯ͠Β͓͏ •
ΈΜͳ͍͖ͩ͢ Producer-Consumer ύλʔϯ • ϩάΠϕϯτ͕ Slack ্Ͱલޙ͢ΔͷΑ͘ͳ͍Α Ͷ
ΞϓϦέʔγϣϯऴྃ࣌ͷҙ • Consumer ͷεϨουσʔϞϯεϨουʹ͠ਏ͍ • Thread#setDaemon() • ϩάΠϕϯτ͕ϩάΒΕͣʹফࣦͯ͠͠·͏ࣄଶආ͚͍ͨ •
AppenderBase#stop() ΛΦʔόʔϥΠυ͢ΕΑͦ͞͏ʁ • ࣮ࡍɺ͜ͷࢠΞϓϦέʔγϣϯऴྃ࣌ʹݺͼग़͞ΕΔΘ ͚Ͱͳ͍…ʁϩάϝοηʔδ͕ Slack ্Ͱલޙ͢ΔͷΑ ͘ͳ͍͠
ΞϓϦέʔγϣϯऴྃ࣌ͷҙ • ํͳ͍ͷͰɺҎԼͷΑ͏ͳϔϧύʔϝιο υΛఏڙ͓ͯ͠Λ͢͜ͱʹ • ࠜຊతͳղܾํ๏ืूத
3. logback.xml ͰઃఆͰ͖Δ ΈΛఏڙ͢Δ
ͱͬͯ؆୯ • Appender ࣮ΫϥεʹϓϩύςΟ (getter/ setter) Λ༻ҙ͢Ε OK • ޙͰίʔυΛ͓ݟͤ͠·͢
logback.xml Ͱͷઃఆ͜Μͳײ͡
σϞ
͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ