SlideShare a Scribd company logo
1 of 38
Download to read offline
LogStage - zero cost
structured logging
Maksym Ratoshniuk, 7mind.io
Yet another logger?
What is a structured
logging?
Common use cases:
● Tracing
● Liveness of your system
● Metrics
○ DB Calls
○ Http flow
○ Payment processing
○ Scheduling (jobs)
● Analytics
○ User behaviour
○ A/B Testing
Challenges
1. Broken SOLID and lot’s of
magic
Fluentd
?
Scala-logging
Finatra
2. Production unreadiness
● Asynchronous sinks
● File rotation
● Json rendering
● User context (like MDC)
● No performance hotspots
3. Jar Hell
3. Singletons and jar hell
We always write code...
… that is always structured
Logging always should be easy to read...
class ExampleService(log: IzLogger) {
val justAnArg = "example"
val justAList = List[Any](10, "green", "bottles")
log.trace(s"Argument: $justAnArg, another arg: $justAList")
log.info(s"Named expression: ${Random.nextInt() -> "random number"}")
log.warn(s"Invisible: ${Random.nextInt() -> "random number" -> null}")
val ctxLog = log("userId" -> "user@google.com", "company" -> "acme")
val delta = Random.nextInt(1000)
ctxLog.info(s"Processing time: $delta")
}
… and easier to deal with
class ExampleService(logger: IzLogger)
{
val justAnArg = "example"
val justAList = List[Any](
10, "green", "bottles"
)
logger.trace(
s"Argument: $justAnArg, another
arg: $justAList"
)
}
Features
Macro-based structuring and context
extraction
● Argument names, types, ordering
● Static information (file, line, class, function)
● Static part of our message - message template
(interpolation context)
Aliasing for references
Dynamic context & method
granularity
Reference configuration
SLF4J backend
A drop-in replacement for Logback, route your
legacy logs also
Out of box provisioning
- Console sink
- File sink
- Asynchronous sink (single worker thread at
the moment)
- String and Json rendering
Effectful adapters for ZIO, Cats, Monix
Automatic structure identifiers
Template as an identifier
If you have a structured
DB as a storage, you can
querying your logs with
the same structure
Let’s dive into coding
Almost no dependencies
Clean, neat, no singletons (except slf4j interop),
which may impact on working of systems with
isolated classloaders
Modular
Implement you own sink, router, policy, rotation
DI ready
Two separate settings
set.
Isn’t cool? 😍
DIStage out of box
Comparison with popular frameworks
Logstage Scribe Airframe Logback + SLF4j Scala Logging
Structured ✅ ❌ ❌ ❌ ❌
SOLID rules ✅ ❌ ❌ ❌ ❌
No singletons ✅ ❌ ❌ ❌ ❌
Modularity ✅ ❌ ❌ ❌ ❌
Asynchronous ✅ ✅ ✅ ✅ ✅
DI-readiness ✅ ❌ ❌ ❌ ❌
Colourful ✅ ❌ ✅ ✅ ❌
Dynamic Context ✅ ❌ ❌ ✅ ✅
File rotation ✅ ✅ ✅ ✅ ✅
Plans to work with
● Rethinking of rendering policy
● Better configuration
● Integrations with Logback, Azure,
ElasticSearch, Kafka
● Profiling and optimization performance
Welcome to contribution
Thank you for listening!
https://github.com/7mind
https://ratoshniuk.github.io/
https://github.com/ratoshniuk/scalaua-2019

More Related Content

What's hot

Brett Ragozzine - Graph Databases and Neo4j
Brett Ragozzine - Graph Databases and Neo4jBrett Ragozzine - Graph Databases and Neo4j
Brett Ragozzine - Graph Databases and Neo4j
Brett Ragozzine
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
shimi_k
 
Mis Conceptions About The Tiny Java
Mis Conceptions About The Tiny JavaMis Conceptions About The Tiny Java
Mis Conceptions About The Tiny Java
Sultan Jokhio
 

What's hot (19)

Python
PythonPython
Python
 
The ECM world from the point of view of Alfresco - Linux Day 2013 - Rome
The ECM world from the point of view of Alfresco - Linux Day 2013 - RomeThe ECM world from the point of view of Alfresco - Linux Day 2013 - Rome
The ECM world from the point of view of Alfresco - Linux Day 2013 - Rome
 
Brett Ragozzine - Graph Databases and Neo4j
Brett Ragozzine - Graph Databases and Neo4jBrett Ragozzine - Graph Databases and Neo4j
Brett Ragozzine - Graph Databases and Neo4j
 
DBpedia Viewer - LDOW 2014
DBpedia Viewer - LDOW 2014DBpedia Viewer - LDOW 2014
DBpedia Viewer - LDOW 2014
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Xml3
Xml3Xml3
Xml3
 
Programming for Performance
Programming for PerformanceProgramming for Performance
Programming for Performance
 
Ruby Under The Hood - By Craig Lehmann and Robert Young - Ottawa Ruby Novembe...
Ruby Under The Hood - By Craig Lehmann and Robert Young - Ottawa Ruby Novembe...Ruby Under The Hood - By Craig Lehmann and Robert Young - Ottawa Ruby Novembe...
Ruby Under The Hood - By Craig Lehmann and Robert Young - Ottawa Ruby Novembe...
 
Red Hat Summit 2017 - LT107508 - Better Managing your Red Hat footprint with ...
Red Hat Summit 2017 - LT107508 - Better Managing your Red Hat footprint with ...Red Hat Summit 2017 - LT107508 - Better Managing your Red Hat footprint with ...
Red Hat Summit 2017 - LT107508 - Better Managing your Red Hat footprint with ...
 
Grails workshops
Grails workshopsGrails workshops
Grails workshops
 
Session 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, SetsSession 17 - Collections - Lists, Sets
Session 17 - Collections - Lists, Sets
 
6 Months Project Training in PHP
6 Months Project Training in PHP6 Months Project Training in PHP
6 Months Project Training in PHP
 
[Webinar] Scientific Computation and Data Visualization with Ruby
[Webinar] Scientific Computation and Data Visualization with Ruby [Webinar] Scientific Computation and Data Visualization with Ruby
[Webinar] Scientific Computation and Data Visualization with Ruby
 
Identifying Web Attacks Via Data Analysis
Identifying Web Attacks Via Data AnalysisIdentifying Web Attacks Via Data Analysis
Identifying Web Attacks Via Data Analysis
 
Why do we need TypeScript?
Why do we need TypeScript?Why do we need TypeScript?
Why do we need TypeScript?
 
Indexing, searching, and aggregation with redi search and .net
Indexing, searching, and aggregation with redi search and .netIndexing, searching, and aggregation with redi search and .net
Indexing, searching, and aggregation with redi search and .net
 
Mis Conceptions About The Tiny Java
Mis Conceptions About The Tiny JavaMis Conceptions About The Tiny Java
Mis Conceptions About The Tiny Java
 
RIO Distribution: Reconstructing the onion - Shyamsundar Ranganathan
RIO Distribution: Reconstructing the onion - Shyamsundar RanganathanRIO Distribution: Reconstructing the onion - Shyamsundar Ranganathan
RIO Distribution: Reconstructing the onion - Shyamsundar Ranganathan
 
RG OOP-talk
RG OOP-talkRG OOP-talk
RG OOP-talk
 

Similar to Log stage zero-cost structured logging

Similar to Log stage zero-cost structured logging (20)

Log Management Systems
Log Management SystemsLog Management Systems
Log Management Systems
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
Kibana+ElasticSearch+LogStash to handle Log messages on Prod serversKibana+ElasticSearch+LogStash to handle Log messages on Prod servers
Kibana+ElasticSearch+LogStash to handle Log messages on Prod servers
 
MongoDB 3.2 - a giant leap. What’s new?
MongoDB 3.2 - a giant leap. What’s new?MongoDB 3.2 - a giant leap. What’s new?
MongoDB 3.2 - a giant leap. What’s new?
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015
 
Go debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFxGo debugging and troubleshooting tips - from real life lessons at SignalFx
Go debugging and troubleshooting tips - from real life lessons at SignalFx
 
MongoDB - visualisation of slow operations
MongoDB - visualisation of slow operationsMongoDB - visualisation of slow operations
MongoDB - visualisation of slow operations
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Eko10 - Security Monitoring for Big Infrastructures without a Million Dollar ...
Eko10 - Security Monitoring for Big Infrastructures without a Million Dollar ...Eko10 - Security Monitoring for Big Infrastructures without a Million Dollar ...
Eko10 - Security Monitoring for Big Infrastructures without a Million Dollar ...
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Configuring Syslog by Octavio
Configuring Syslog by OctavioConfiguring Syslog by Octavio
Configuring Syslog by Octavio
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
BUD17-302: LLVM Internals #2
BUD17-302: LLVM Internals #2 BUD17-302: LLVM Internals #2
BUD17-302: LLVM Internals #2
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Logging for Containers
Logging for ContainersLogging for Containers
Logging for Containers
 
Containers and Logging
Containers and LoggingContainers and Logging
Containers and Logging
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @Lendingkart
 
Security Monitoring for big Infrastructures without a Million Dollar budget
Security Monitoring for big Infrastructures without a Million Dollar budgetSecurity Monitoring for big Infrastructures without a Million Dollar budget
Security Monitoring for big Infrastructures without a Million Dollar budget
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at night
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Log stage zero-cost structured logging