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
Christian Grobmeier on Log4j 2
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Enterprise Java User Group Austria
November 26, 2014
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Christian Grobmeier on Log4j 2
Enterprise Java User Group Austria
November 26, 2014
More Decks by Enterprise Java User Group Austria
See All by Enterprise Java User Group Austria
Gerrit Grunwald on What the CRaC... SUPERFAST JVM STARTUP
ejug
2
200
Spring Framework 5.2 - Core Container Revisited
ejug
0
180
Andreas Caternberg on Jenkins Pipelines
ejug
0
790
Martin Ahrer on Continuous Delivery Infrastructure With Docker
ejug
0
160
Dirk Mahler on Software Analyse mit jQAssistant & Neo4j
ejug
1
310
Christoph Strobl on Spring Data & Hypermedia
ejug
0
160
Stefan Armbruster on Graph Modelling Antipatterns
ejug
1
140
Stefan Armbruster on Introduction into Neo4J
ejug
1
100
Michael Nitschinger on Building a reactive Couchbase driver for the JVM
ejug
0
160
Other Decks in Technology
See All in Technology
Fabricをフル活用する AI Agent Hub -製造業特化AIエージェントの設計
iotcomjpadmin
0
180
AWS Blocks を触ってみた/first-tach-aws-blocks
fossamagna
2
110
起点・思考・出力で分解する 〜PM業務の自動化設計〜
kazu_kichi_67
2
1.2k
打造你的 AI 工作流:Agent Skill + MCP 實戰工作坊
appleboy
0
340
製造現場での生成AIの活用、およびエージェントAIの実装のあり方、AVEVAの取り組み
iotcomjpadmin
0
210
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
180
#エンジニアBooks 30分でわかる 「技術記事を書く技術」 / engineer-books 2026-06-30
jnchito
1
160
5分でわかる Amazon Connect_20260608
hwangbyeonghun
0
160
40代で“やっとエンジニアになれた”――閉じた学びを開き、空の青さを知る / 20260628 Naoki Takahashi
shift_evolve
PRO
4
1.6k
GitHub Copilot運用のリアル ~AI Credit時代にどう向き合うか~
takafumisu2uk1
0
600
LiDAR SLAMの実装とセンサ融合 ~Lie群からContinuous-Time LIOまで~
naokiakai
1
810
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
160
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Building Applications with DynamoDB
mza
96
7.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
490
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
450
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
210
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
270
Transcript
Apache Log4j 2
Christian Grobmeier @grobmeier http://www.grobmeier.de ASF V. P. Logging Services
http://www.leanpub.com/thezenprogrammer/c/linz
(hopefully) soon: www.understandinglog4j.com
Why should you log?
ASF FIRE BRIGADE
Log4j1, Log4j2 log4php Chainsaw log4net log4cxx
How do you log?
We are stable! Log4j 2.1
None
CHALLENGES
SPEED!
Failsafe. Reliable.
Compability.
Taste.
L o g g i n g with Duke
Too much t a s t e . . .
m a k e s headache! Think on: log4j, logback, JUL, TinyLog, AVSL
Pills: Some Abstraction Layers
Commons Logging log4j 1 log4j 2 logback JUL Which pill?
slf4j Commons Logging log4j 1 log4j 2 logback JUL AVSL
Which pill?
slf4j Commons Logging log4j 1 log4j 2 logback JUL AVSL
New kids on the block log4j 2
log4j 2.x is the future of log4j
New in log4j 2.x
Instead: if (logger.isDebugEnabled()) logger.info("Hi, " + u.getA() + “ “
+ u.getB()); Write: logger.info("Hi, {} {} ", u.getA(), u.getB()); API++
Marker: Marker SQL_MARKER = MarkerManager.getMarker("SQL"); logger.debug( SQL_MARKER, "SELECT * FROM
{}", table); Better Filter
@Plugin(name = "Mine", type = "Core", elementType = "appender") public
class Mine extends AppenderBase { private Mine(String name, Filter f) { super(name, f, null); } public void append(LogEvent e) { … } Plugins
@PluginFactory public static Mine create( @PluginAttr("name") String n, @PluginElement("filters") Filter
f) { return new Mine(n, f); } Plugins
<appenders> <Mine name="Hello_Linz" …> <PatternLayout pattern="%d{HH:mm} %msg%n"/> </Mine> </appenders> Configuration
<Configuration> <Appenders> <File name="Grobmeier" fileName="target/mylog.log"> <PatternLayout> <Pattern>%d %C{1.}</Pattern> </PatternLayout> </File>
</Appenders> <Loggers> <Logger name="com.Bar" level="trace"> <AppenderRef ref="Grobmeier"/> </Logger> Configuration
<File name="App" fileName="app.log"> <PatternLayout> <pattern> %d $${jndi:logging/context-name} %m%n </pattern> </PatternLayout>
</File> Configuration
JSON { "configuration": … "appenders": { "Console": { "name": "STDOUT",
"PatternLayout": { "pattern": "%m%n" } }, ...
Configuration Reloading <configuration monitorInterval="30"> ... </configuration>
More? MDC (ThreadContext) EventLogger Flowtracing …
SPEED! log4j 1.x logback log4j 2.x Disabled 5 2386 2116
2314 Logging Performance in ns
SPEED! Async Logging Power!
Again: >18,000,000 messages / second On Solaris 10 (64bit) with
JDK1.7.0_06, 4-core Xeon X5570 dual CPU @2.93Ghz with hyperthreading switched on (16 virtual cores)
LMAX DISRUPTOR removes the kernel need for locks on the
CPU level
CHAINSAW
None
The story of log4php Community
Good times, bad times 1999 2005 2010 2011
You are welcome Join ~8 active committers.
We are back! 2013: 1018 Changes 4730 Mails 2014: 1502
Changes 8501 Mails
Seriously. Isn‘t logging just BORING?
Well... how do you log on your mobile/cloud apps?
With new innovation, new logging challenges come up. Logging needs
innovation too.
Logger Log Collector Log Search Log Analysis
Logger Log Collector Log Search Log Analysis
Logger Log Collector Log Search Log Analysis
None
Logging is mission critical.
One last thing...
Do we need a new Logging JSR? java.net/projects/newlogging
We are hiring! use it! ask questions! spread the love!
send patches!
[email protected]
Christian Grobmeier @grobmeier http://www.grobmeier.de Merci && Baba!
Image Credits Writing Girl (Erin Kohlenberg) Captain Kirk (http://dave-daring.deviantart.com/) Vulcano
(Martin Barland) Fire Brigade (State Library of South Australia) Gear Necklace Designs (Eric Skiff) Gazelle (Flickr: fwooper) Golden Gate Bridge (Flickr: TimeLapseBlog.com) Pens (Flickr: JD | Photography) Wineglass (Flickr: Willia4) Headache (Flickr: Threephin) Pills (Dr. Michael Günther) Wheelgear (Flickr: ralphbijker) Chainsaw (Flickr: Dave Hosford) Elephant (Flickr: Werner Vermaak) Haunted House (Flickr: barb_ar) SOS (Flickr: Daquella Manera) Bathtime muscles (Flickr: mollypop) Yawning Animal (Flickr: robef) Mobile (Flickr: twicepix) Steve (https://www.flickr.com/photos/-macjasp/) Paul Carmody Clouds (Flickr: karindalziel) Fight (Flickr: KellBailey)