Suche senden
Hochladen
Logging in Scala
•
4 gefällt mir
•
3,791 views
John Nestor
Folgen
Describes a new logger written in Scala.
Weniger lesen
Mehr lesen
Software
Melden
Teilen
Melden
Teilen
1 von 37
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Introduction to Scala Macros
Introduction to Scala Macros
Knoldus Inc.
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
Knoldus Inc.
Scala Days NYC 2016
Scala Days NYC 2016
Martin Odersky
Introduction to Scala JS
Introduction to Scala JS
Knoldus Inc.
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
mircodotta
Introduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
mircodotta
Drilling the Async Library
Drilling the Async Library
Knoldus Inc.
Empfohlen
Introduction to Scala Macros
Introduction to Scala Macros
Knoldus Inc.
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
Knoldus Inc.
Scala Days NYC 2016
Scala Days NYC 2016
Martin Odersky
Introduction to Scala JS
Introduction to Scala JS
Knoldus Inc.
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
mircodotta
Introduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
mircodotta
Drilling the Async Library
Drilling the Async Library
Knoldus Inc.
Building scalable rest service using Akka HTTP
Building scalable rest service using Akka HTTP
datamantra
Akka Actor presentation
Akka Actor presentation
Gene Chang
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
What’s expected in Spring 5
What’s expected in Spring 5
Gal Marder
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
Havoc Pennington
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Lightbend
Developing Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For Scala
Lightbend
Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"
Markus Jura
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2
Knoldus Inc.
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
Scala final ppt vinay
Scala final ppt vinay
Viplav Jain
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Codemotion
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx France
Trisha Gee
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
Shashank L
Dive into spark2
Dive into spark2
Gal Marder
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Codemotion
Spark real world use cases and optimizations
Spark real world use cases and optimizations
Gal Marder
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
takezoe
JVM languages "flame wars"
JVM languages "flame wars"
Gal Marder
Introduction to Apache Apex
Introduction to Apache Apex
Apache Apex
What's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
Amazon Web Services
Weitere ähnliche Inhalte
Was ist angesagt?
Building scalable rest service using Akka HTTP
Building scalable rest service using Akka HTTP
datamantra
Akka Actor presentation
Akka Actor presentation
Gene Chang
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
What’s expected in Spring 5
What’s expected in Spring 5
Gal Marder
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
Havoc Pennington
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Lightbend
Developing Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For Scala
Lightbend
Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"
Markus Jura
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2
Knoldus Inc.
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Konstantin Tsykulenko
Scala final ppt vinay
Scala final ppt vinay
Viplav Jain
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Codemotion
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx France
Trisha Gee
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
Shashank L
Dive into spark2
Dive into spark2
Gal Marder
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Codemotion
Spark real world use cases and optimizations
Spark real world use cases and optimizations
Gal Marder
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
takezoe
JVM languages "flame wars"
JVM languages "flame wars"
Gal Marder
Was ist angesagt?
(20)
Building scalable rest service using Akka HTTP
Building scalable rest service using Akka HTTP
Akka Actor presentation
Akka Actor presentation
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
What’s expected in Spring 5
What’s expected in Spring 5
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Developing Secure Scala Applications With Fortify For Scala
Developing Secure Scala Applications With Fortify For Scala
Lagom - Mircoservices "Just Right"
Lagom - Mircoservices "Just Right"
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2
Developing distributed applications with Akka and Akka Cluster
Developing distributed applications with Akka and Akka Cluster
Scala final ppt vinay
Scala final ppt vinay
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx France
Introduction to concurrent programming with Akka actors
Introduction to concurrent programming with Akka actors
Dive into spark2
Dive into spark2
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Tomer Elmalem - GraphQL APIs: REST in Peace - Codemotion Milan 2017
Spark real world use cases and optimizations
Spark real world use cases and optimizations
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
JVM languages "flame wars"
JVM languages "flame wars"
Ähnlich wie Logging in Scala
Introduction to Apache Apex
Introduction to Apache Apex
Apache Apex
What's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
Amazon Web Services
Scala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big Data
John Nestor
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
Max Alexejev
Scala at Treasure Data
Scala at Treasure Data
Taro L. Saito
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructure
harendra_pathak
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays
Apache Kafka
Apache Kafka
emreakis
Log management with ELK
Log management with ELK
Geert Pante
Getting started with postgresql
Getting started with postgresql
botsplash.com
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
Cask Data
Novinky v Oracle Database 18c
Novinky v Oracle Database 18c
MarketingArrowECS_CZ
Intro to Apache Apex @ Women in Big Data
Intro to Apache Apex @ Women in Big Data
Apache Apex
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
Jaemi Bremner
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
Derek Collison
Ingestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache Apex
Apache Apex
Rootconf 2017 - State of the Open Source monitoring landscape
Rootconf 2017 - State of the Open Source monitoring landscape
NETWAYS
Technology behind-real-time-log-analytics
Technology behind-real-time-log-analytics
Data Science Thailand
Tech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore Roadmap
AdaCore
Spark Uber Development Kit
Spark Uber Development Kit
DataWorks Summit/Hadoop Summit
Ähnlich wie Logging in Scala
(20)
Introduction to Apache Apex
Introduction to Apache Apex
What's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
Scala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big Data
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
Scala at Treasure Data
Scala at Treasure Data
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructure
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
Apache Kafka
Apache Kafka
Log management with ELK
Log management with ELK
Getting started with postgresql
Getting started with postgresql
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
Novinky v Oracle Database 18c
Novinky v Oracle Database 18c
Intro to Apache Apex @ Women in Big Data
Intro to Apache Apex @ Women in Big Data
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
Ingestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache Apex
Rootconf 2017 - State of the Open Source monitoring landscape
Rootconf 2017 - State of the Open Source monitoring landscape
Technology behind-real-time-log-analytics
Technology behind-real-time-log-analytics
Tech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore Roadmap
Spark Uber Development Kit
Spark Uber Development Kit
Mehr von John Nestor
LambdaFlow: Scala Functional Message Processing
LambdaFlow: Scala Functional Message Processing
John Nestor
LambdaTest
LambdaTest
John Nestor
Type Checking Scala Spark Datasets: Dataset Transforms
Type Checking Scala Spark Datasets: Dataset Transforms
John Nestor
Messaging patterns
Messaging patterns
John Nestor
Experience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
John Nestor
Scala Json Features and Performance
Scala Json Features and Performance
John Nestor
Neutronium
Neutronium
John Nestor
Mehr von John Nestor
(7)
LambdaFlow: Scala Functional Message Processing
LambdaFlow: Scala Functional Message Processing
LambdaTest
LambdaTest
Type Checking Scala Spark Datasets: Dataset Transforms
Type Checking Scala Spark Datasets: Dataset Transforms
Messaging patterns
Messaging patterns
Experience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
Scala Json Features and Performance
Scala Json Features and Performance
Neutronium
Neutronium
Kürzlich hochgeladen
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
vaideheekore1
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
Christopher Curtin
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
itservices996
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
maor17
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
Bert Jan Schrijver
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
OnePlan Solutions
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
Andrey Devyatkin
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Shane Coughlan
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Applitools
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Drew Moseley
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
RTS corp
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
team-WIBU
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
Andreas Kunz
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
ABSYZ Inc
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
Neo4j
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Christian Birchler
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
OnePlan Solutions
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
KrzysztofKkol1
Kürzlich hochgeladen
(20)
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Logging in Scala
1.
Logging in Scala John
Nestor 47 Degrees www.47deg.com August 9, 2016 147deg.com
2.
47deg.com © Copyright
2016 47 Degrees Outline • Introduction • Architecture • Features • Implementation • Demos • Cross Service Log Aggregation 2
3.
Introduction 3
4.
47deg.com © Copyright
2016 47 Degrees Existing Scala Loggers • Java loggers (used in Scala code) • Log4j (used in Spark) • SLF4J and Logback • Scala loggers • Abandoned: Configgy, Logula (Coda Hale) • Log4s (wraps SLF4J) • scala-logging (Heiko Seeberger) (wraps Log4j) • Special Scala loggers • Akka actor logging (can route to Logback) • Play logging (uses Logback) 4
5.
47deg.com © Copyright
2016 47 Degrees Why a New Logger? • Pure Scala. (No Java code) • Richer messages (Json rather than text strings) • Aggregate logs across multiple (micro-)services • Clean design with rich features 5
6.
47deg.com © Copyright
2016 47 Degrees New Scala Logger History • Whitepages Logger - part of a new Scala web service framework • Persist Logger (work supported by 47 Degrees) • clean up and improve API • removed Whitepages specific stuff • added complete documentation • Full source and documentation on Github • Maven central "com.persist" % "persist-logging_2.11" % "1.2.4" • Apache 2 license 6
7.
47deg.com © Copyright
2016 47 Degrees Rich Logging Example log.error(s”Too many values Size:${vals.size} Max:${vals.max}”) log.error(map(“msg”->”Too many values”, ”Size”->vals.size, ”Max”->vals.max), id=currentId) {“msg”:”Too Many Values”, “Size”: 10, “Max: “33} 7
8.
Architecture 8
9.
47deg.com © Copyright
2016 47 Degrees Persist Logger Architecture 9 logging.conf logback.xml Scala Logger API Slf4j API Akka Actor Logging API Custom Logback Appender LogBack Custom Akka Logging Actor Logging Actor Stdout Appender File Appender Kafka Appender Other Appenders Logger State Scala Logger Control API
10.
Features 10
11.
47deg.com © Copyright
2016 47 Degrees API Log Call • Level • Rich Message • Id (optional) • Per request level control • Per request log aggregation • Exception (optional) • use RichException for a RichMessage 11
12.
47deg.com © Copyright
2016 47 Degrees Rich Messages • String • Int, Long, Float, Double, BigDecimal • null, Boolean • Seq[RichMessage] • Map[String,RichMessage] 12
13.
47deg.com © Copyright
2016 47 Degrees Why Json? • Easy to support rich metadata in addition to the message • Easier to parse in downstream tools • No need to manually escape strings • Naturally supports multiline messages • Standard text format • But many internal possibilities • This logger uses Persist Json (only internally) • Rich messages use standard Scala types for in internal API 13
14.
47deg.com © Copyright
2016 47 Degrees Kind of Logs • Error log • Alternative logs • GC • Timing (for fine grain timing) • Server (request-response, duration) • Client (request, response, duration) • User defined 14
15.
47deg.com © Copyright
2016 47 Degrees Standard Fields • @category (error, gc, …) • @host • @service • @severity (info, debug, warn, error, …) • @timestamp (msec) • class, file, line, actor • msg • trace (for exceptions, Json) 15
16.
47deg.com © Copyright
2016 47 Degrees Appenders • Stdout • no server/service specific fields • color (optional) • summary • File (daily rotation) • Kafka • Custom, user defined • Control destination • Control contents and format 16
17.
47deg.com © Copyright
2016 47 Degrees Level Control • logging.conf (default options), can override • uses Typesafe config • levels: API, SLF4J, Akka • Change level via API • Per request custom level • Custom filters • Based on level, and content 17
18.
47deg.com © Copyright
2016 47 Degrees Timing • Fine grain timing • Uses request ids to aggregate • Time in microseconds • Time log • Can be used with concurrency (futures and actors) 18
19.
47deg.com © Copyright
2016 47 Degrees Other Loggers • Captures messages from other legacy loggers that might be used in new project libraries • SLF4J (captured via Logback appender) • Akka Actor Logging (captured by custom Akka log handing actor) 19
20.
47deg.com © Copyright
2016 47 Degrees Look At Documentation • logging.conf • Overview • API 20
21.
Implementation 21
22.
47deg.com © Copyright
2016 47 Degrees Persist Logger Architecture 22 logging.conf logback.xml Scala Logger API Slf4j API Akka Actor Logging API Custom Logback Appender LogBack Custom Akka Logging Actor Logging Actor Stdout Appender File Appender Kafka Appender Other Appenders Logger State Scala Logger Control API
23.
47deg.com © Copyright
2016 47 Degrees Dealing with Concurrency • The logging actor provides fully generalized sync • Serializes output • Handles filters • But asking the actor on every message can be slow • @volatile booleans for each log level associated with logger • Note the logger itself is global state • One copy for entire app, no need to pass a parameter everywhere: ClassLogging and ActorLogging traits. • Must start before any messages and stop after any messages (but there is a development workaround) • Contains log level booleans 23
24.
47deg.com © Copyright
2016 47 Degrees Source Location • Could find using exception stack trace at run-time • Better solution is to use Scala macro and reflection at compile-time 24
25.
Demos 25
26.
47deg.com © Copyright
2016 47 Degrees Demos • Simple • Actor • Exceptions • Request Id • Alternative • Other (Actor, SLF4J) • Timing • Filter • Appender 26
27.
Cross Service Log Aggregation 27
28.
47deg.com © Copyright
2016 47 Degrees The Problem • Applications are being split into ever more micro- services • Much harder to answer questions? • What is the overall control flow for various requests? • What was the root cause of an error? • Where are the performance bottlenecks? • In this talk we look at a prototype system that can be used to answer these kinds of questions • Work in progress 28
29.
47deg.com © Copyright
2016 47 Degrees Related Work • Google Dapper • Zipkin • Akka Tracing (wraps Zipkin) 29
30.
47deg.com © Copyright
2016 47 Degrees Approach • Use Scala as much as possible • Aggregate logs for each independent request across a set of Scala services • Provide a basis for both • Near real-time • Alerts • View aggregated logs for any request • More comprehensive batch analysis • Failure statistics • Overall patterns • Trends over time 30
31.
47deg.com © Copyright
2016 47 Degrees Overall Architecture 31 Kafka Spark Streaming (Aggregation) NoSql DB REST Log API * (Merge, Filter) Services * * Uses: Persist Service Framework Persist Service Framework Uses: Akka HTTP Persist Json Persist Logger Spark Batch Analytics
32.
47deg.com © Copyright
2016 47 Degrees Scala REST Service 32 Server Log Service (can be lots of these) Error Log Client Log ... To Other Services Kafka (only one cluster/topic for all logs and services) ... From Other Services
33.
47deg.com © Copyright
2016 47 Degrees Services 33 Serial A Driver E D C B Parallel
34.
47deg.com © Copyright
2016 47 Degrees Aggregation (via Spark Streaming) • Pass from client to server • Client name • Tracking Id • same for a single request across all micro services • Span Id • unique for each call for a given Client-Server pair • Match Tracking Id and Span Id across • Client log • Server log 34
35.
47deg.com © Copyright
2016 47 Degrees Cross Service Matching 35 Id1 Span1 X A Id1 Span1 X Id1 Span2 A Id1 Span3 A A Id1 Span1 Span2 B B Id1 Span2 A B Id1 Span3 A A Id1 Span1 Span3 B Match Match Match Match Service A Service B
36.
47deg.com © Copyright
2016 47 Degrees Look at Sample Output • Array of log messages • Tree of log messages • Filtered tree with timings 36
37.
Questions 37
Jetzt herunterladen