SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Managing the logs of your (Rails) applications Lennart Koopmann,  RailsWayCon 2011 www.lennartkoopmann.net / @_lennart
About me 23 years old Living in Hamburg Rails developer at XING AG Developer of Graylog2
What is this log management stuff? Even grepping over flat files can be log management.
Log Management Maturity Scale Log management has different levels – Raffael Marty set up a scale for that.
Level 0 Do not collect logs at all.
Level 1 Collect logs. Mostly simple log files from email or HTTP servers.
Level 2 Use the logs for forensics and troubleshooting. Why was that email not sent out? Why was that HTTP 500 thrown?
Level 3 Save searches. The most basic case would be to save a grep command you used.
Level 4 Share searches. Store that search command somewhere so co-workers can find and use it to solve the same problem.
Level 5 Reporting.
Level 6 Alerting. Automate some of your troubleshooting tasks. Be warned automatically instead of waiting for a user to complain.
Level 7 Collect more logs! We may need more sources for some use cases – Like multi-line application logs, firewall logs or even physical access logs.
Level 8 Correlation. Manual analysis of all this new data may take too long – Correlate different sources.
Level 9 Visual analysis.
Next levels Pattern detection, interactive visualization, dynamic queries, anomaly detection, more sharing.
Collecting logs Two different types.
Type 1 Logs automatically generated from a service. For example apache2.log or mail.log – Usually huge amount of structured, but raw data. jira.graylog2.org:80 x.x.x.x - - [29/May/2011:01:47:38 +0200] "GET /browse/WEBINTERFACE-21?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel HTTP/1.1" 200 7639 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
Type 2 Logs sent directly from within your application. Triggered for example by a log.error() call or an Exception catcher. - Possible to send structured via for example GELF 2011-05-29 18:55:51 +0200 [payment] Could not validate credit card: Got HTTP 404 from example.org
How to send your logs Don't store the logs in flat files. Send them somewhere to get more value out of them.
Syslog Syslog adapters for Rails are available and work pretty good.
GELF Graylog extended log format – Let's you structure your logs. Also check out structured syslog. Ruby library, Rack exception notifier and Ruby logger available. ( www.graylog2.org )
{ ' message ':'[pay] ZOMG credit card invalid', ' full_message ':'Stacktrace.Some env vars', ' host ':'www19', ' file ':'/var/www/app.rb', ' line ':2638, ' level ':1, ' _something ':'foo', ' _something_else ':'bar' }
AMQP Guaranteed and ordered delivery. Very flexible. Easily subscribe to the flow. Use routing keys to structure origin of the logs. Hell yeah, use this if you have an AMQP bus available. (or build one) Check out  https://github.com/paukul/amqp_logging
Throw the messages out of your app like a hot potato Loose coupling! Your logs should always leave the application without interfering it! Prefer UDP over TCP, decouple AMQP log transports. Catch all exceptions and get back into the app flow.
Add more value to your logs For example pre-generate geo information for IP addresses or integrate the time_bandits gem.
https://github.com/skaes/time_bandits Completed in 680.378ms (View: 28.488, DB: 5.111(2,0), MC: 5.382(6r,0m), GC: 120.100(1), HP: 0(2000000,546468,18682541,934967)) | 200 OK [ http://127.0.0.1/jobs/info ] Can generate a deep insight view of your application performance when used with LogJam:  https://github.com/alpinegizmo/logjam
Where to send your logs There are a lot of tools available.
Hosted services: Loggly www.loggly.com Dynamic pricing based on your usage Free for 200MB/day with 1 week retention time UDP/TCP/HTTP API as input for syslog
 
 
Hosted services: Splunk www.splunk.com Two license types: Free / Enterprise Supports any raw input
Two more hosted services: www.papertrailapp.com www.logentries.com
Open source tools: Logstash www.logstash.net Collect, parse and store logs for later use Input -> Filter -> Output Plays very well with Graylog2
Logstash inputs For example: AMQP, file, redis, stdin, syslog, tcp, stomp, twitter
Logstash filters For example: date, field, grep, grok, multiline
Logstash outputs For example: amqp, elasticsearch, gelf, mongodb, redis, stdout, tcp, websocket
 
Open source tools: Graylog2 www.graylog2.org Accepts syslog (TCP/UDP) and GELF (+ AMQP) Rails web interface for filtering, analytics, alerting, reporting, … Stores in MongoDB
 
 
 
 
 
Log management use case: API consumer monitoring Something different from the usual alerting, monitoring and reporting.
Pre-processor script (or Logstash) parses raw access log (possibly via AMQP), combines multi line log messages of API engine and extracts value.
oauth_consumer_key, severity, http_status_code, processed (controller#action)
Pre-processor sends the extracted value including the raw message to Graylog2.
n.notify { :severity => 4, :short_message => “UsersController#show [500]”, :full_message => full_msg, :_oauth_consumer_key => “foo”, :_processed => “UsersController#show”, :_http_status_code => 500, ... ... }
Now use Graylog2 and the MongoDB shell to answer questions like...
What consumers are still using the deprecated find user by email call?
What errors are caused by the iPhone application?
Which applications keep causing errors?
Which consumers are inactive?
How many calls are done by the iPhone application and how many were it a month ago?
Extract everything you might need from the message in a structured format you can easily parse and query later. You already have all the data you need!
Q & A @_lennart www.lennartkoopmann.net

Weitere ähnliche Inhalte

Was ist angesagt?

Apache Kafka DC Meetup: Replicating DB Binary Logs to Kafka
Apache Kafka DC Meetup: Replicating DB Binary Logs to KafkaApache Kafka DC Meetup: Replicating DB Binary Logs to Kafka
Apache Kafka DC Meetup: Replicating DB Binary Logs to KafkaMark Bittmann
 
0.5mln packets per second with Erlang
0.5mln packets per second with Erlang0.5mln packets per second with Erlang
0.5mln packets per second with ErlangMaxim Kharchenko
 
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...Pôle Systematic Paris-Region
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8 Dori Waldman
 
Spark stream - Kafka
Spark stream - Kafka Spark stream - Kafka
Spark stream - Kafka Dori Waldman
 
Sync with async
Sync with  asyncSync with  async
Sync with asyncprabathsl
 
Apache Flink Training: DataStream API Part 1 Basic
 Apache Flink Training: DataStream API Part 1 Basic Apache Flink Training: DataStream API Part 1 Basic
Apache Flink Training: DataStream API Part 1 BasicFlink Forward
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkESUG
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"abend_cve_9999_0001
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Brian Brazil
 
Naresh
NareshNaresh
NareshNaresh
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Storing 16 Bytes at Scale
Storing 16 Bytes at ScaleStoring 16 Bytes at Scale
Storing 16 Bytes at ScaleFabian Reinartz
 
Our way of systems monitoring in application development
Our way of systems monitoring in application developmentOur way of systems monitoring in application development
Our way of systems monitoring in application developmentOCoderFest
 

Was ist angesagt? (20)

Apache Kafka DC Meetup: Replicating DB Binary Logs to Kafka
Apache Kafka DC Meetup: Replicating DB Binary Logs to KafkaApache Kafka DC Meetup: Replicating DB Binary Logs to Kafka
Apache Kafka DC Meetup: Replicating DB Binary Logs to Kafka
 
0.5mln packets per second with Erlang
0.5mln packets per second with Erlang0.5mln packets per second with Erlang
0.5mln packets per second with Erlang
 
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
 
whats new in java 8
whats new in java 8 whats new in java 8
whats new in java 8
 
Spark stream - Kafka
Spark stream - Kafka Spark stream - Kafka
Spark stream - Kafka
 
Sync with async
Sync with  asyncSync with  async
Sync with async
 
Apache Flink Training: DataStream API Part 1 Basic
 Apache Flink Training: DataStream API Part 1 Basic Apache Flink Training: DataStream API Part 1 Basic
Apache Flink Training: DataStream API Part 1 Basic
 
Tcp repair
Tcp repairTcp repair
Tcp repair
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
 
Django debugging
Django debuggingDjango debugging
Django debugging
 
AMC Minor Technical Issues
AMC Minor Technical IssuesAMC Minor Technical Issues
AMC Minor Technical Issues
 
Nmap 9 truth "Nothing to say any more"
Nmap 9 truth "Nothing to say  any more"Nmap 9 truth "Nothing to say  any more"
Nmap 9 truth "Nothing to say any more"
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
Naresh
NareshNaresh
Naresh
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Install
InstallInstall
Install
 
Performance
PerformancePerformance
Performance
 
Storing 16 Bytes at Scale
Storing 16 Bytes at ScaleStoring 16 Bytes at Scale
Storing 16 Bytes at Scale
 
Our way of systems monitoring in application development
Our way of systems monitoring in application developmentOur way of systems monitoring in application development
Our way of systems monitoring in application development
 
Nmap
NmapNmap
Nmap
 

Andere mochten auch

MongoDB Operational Best Practices (mongosf2012)
MongoDB Operational Best Practices (mongosf2012)MongoDB Operational Best Practices (mongosf2012)
MongoDB Operational Best Practices (mongosf2012)Scott Hernandez
 
Petty Cash Management - How To Manage Logs and Transactions
Petty Cash Management - How To Manage Logs and TransactionsPetty Cash Management - How To Manage Logs and Transactions
Petty Cash Management - How To Manage Logs and TransactionsDavid Olson
 
"Grand Challenges" of Log Management
"Grand Challenges" of Log Management"Grand Challenges" of Log Management
"Grand Challenges" of Log ManagementAnton Chuvakin
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & KibanaElastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & KibanaSpringPeople
 
Gaining Operational Insights out of Your Logs
Gaining Operational Insights out of Your LogsGaining Operational Insights out of Your Logs
Gaining Operational Insights out of Your LogsAmazon Web Services
 
Final project report format
Final project report formatFinal project report format
Final project report formatMasud Sarkar
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentationadamcookeuk
 

Andere mochten auch (14)

Debugging rails
Debugging railsDebugging rails
Debugging rails
 
MongoDB Operational Best Practices (mongosf2012)
MongoDB Operational Best Practices (mongosf2012)MongoDB Operational Best Practices (mongosf2012)
MongoDB Operational Best Practices (mongosf2012)
 
Petty Cash Management - How To Manage Logs and Transactions
Petty Cash Management - How To Manage Logs and TransactionsPetty Cash Management - How To Manage Logs and Transactions
Petty Cash Management - How To Manage Logs and Transactions
 
"Grand Challenges" of Log Management
"Grand Challenges" of Log Management"Grand Challenges" of Log Management
"Grand Challenges" of Log Management
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & KibanaElastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
 
Log Files
Log FilesLog Files
Log Files
 
Gaining Operational Insights out of Your Logs
Gaining Operational Insights out of Your LogsGaining Operational Insights out of Your Logs
Gaining Operational Insights out of Your Logs
 
Scala vs Ruby
Scala vs RubyScala vs Ruby
Scala vs Ruby
 
Ruby on Rails for beginners
Ruby on Rails for beginnersRuby on Rails for beginners
Ruby on Rails for beginners
 
Final project report format
Final project report formatFinal project report format
Final project report format
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
RSpec 2 Best practices
RSpec 2 Best practicesRSpec 2 Best practices
RSpec 2 Best practices
 
Logs management
Logs managementLogs management
Logs management
 
Project Report Format
Project Report FormatProject Report Format
Project Report Format
 

Ähnlich wie Managing the logs of your (Rails) applications - RailsWayCon 2011

Managing the logs of your (Rails) applications - Arrrrcamp 2011
Managing the logs of your (Rails) applications - Arrrrcamp 2011Managing the logs of your (Rails) applications - Arrrrcamp 2011
Managing the logs of your (Rails) applications - Arrrrcamp 2011lennartkoopmann
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic SystemTimely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic SystemAccumulo Summit
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataGetInData
 
Serverless London 2019 FaaS composition using Kafka and CloudEvents
Serverless London 2019   FaaS composition using Kafka and CloudEventsServerless London 2019   FaaS composition using Kafka and CloudEvents
Serverless London 2019 FaaS composition using Kafka and CloudEventsNeil Avery
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...GetInData
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at ScaleSean Zhong
 
Logging & Metrics with Docker
Logging & Metrics with DockerLogging & Metrics with Docker
Logging & Metrics with DockerStefan Zier
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaJoe Stein
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
 
When third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realWhen third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realCharles Vazac
 
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!NETWAYS
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsMarcelo Pinheiro
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.Renzo Tomà
 
PRMA - Introduction
PRMA - IntroductionPRMA - Introduction
PRMA - IntroductionBowen Cai
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdbRoman Podoliaka
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realAkamai Developers & Admins
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealNicholas Jansma
 
OpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integrationOpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integrationMichiel Kalkman
 
How to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt FileHow to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt FileCA Technologies
 

Ähnlich wie Managing the logs of your (Rails) applications - RailsWayCon 2011 (20)

Managing the logs of your (Rails) applications - Arrrrcamp 2011
Managing the logs of your (Rails) applications - Arrrrcamp 2011Managing the logs of your (Rails) applications - Arrrrcamp 2011
Managing the logs of your (Rails) applications - Arrrrcamp 2011
 
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic SystemTimely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
Timely Year Two: Lessons Learned Building a Scalable Metrics Analytic System
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
 
Serverless London 2019 FaaS composition using Kafka and CloudEvents
Serverless London 2019   FaaS composition using Kafka and CloudEventsServerless London 2019   FaaS composition using Kafka and CloudEvents
Serverless London 2019 FaaS composition using Kafka and CloudEvents
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
 
Logging & Metrics with Docker
Logging & Metrics with DockerLogging & Metrics with Docker
Logging & Metrics with Docker
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache Kafka
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
 
When third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realWhen third parties stop being polite... and start getting real
When third parties stop being polite... and start getting real
 
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.How bol.com makes sense of its logs, using the Elastic technology stack.
How bol.com makes sense of its logs, using the Elastic technology stack.
 
PRMA - Introduction
PRMA - IntroductionPRMA - Introduction
PRMA - Introduction
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting real
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting Real
 
Multicore
MulticoreMulticore
Multicore
 
OpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integrationOpenShift/Kubernetes to Splunk log integration
OpenShift/Kubernetes to Splunk log integration
 
How to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt FileHow to Configure the CA Workload Automation System Agent agentparm.txt File
How to Configure the CA Workload Automation System Agent agentparm.txt File
 

Kürzlich hochgeladen

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

Managing the logs of your (Rails) applications - RailsWayCon 2011

  • 1. Managing the logs of your (Rails) applications Lennart Koopmann, RailsWayCon 2011 www.lennartkoopmann.net / @_lennart
  • 2. About me 23 years old Living in Hamburg Rails developer at XING AG Developer of Graylog2
  • 3. What is this log management stuff? Even grepping over flat files can be log management.
  • 4. Log Management Maturity Scale Log management has different levels – Raffael Marty set up a scale for that.
  • 5. Level 0 Do not collect logs at all.
  • 6. Level 1 Collect logs. Mostly simple log files from email or HTTP servers.
  • 7. Level 2 Use the logs for forensics and troubleshooting. Why was that email not sent out? Why was that HTTP 500 thrown?
  • 8. Level 3 Save searches. The most basic case would be to save a grep command you used.
  • 9. Level 4 Share searches. Store that search command somewhere so co-workers can find and use it to solve the same problem.
  • 11. Level 6 Alerting. Automate some of your troubleshooting tasks. Be warned automatically instead of waiting for a user to complain.
  • 12. Level 7 Collect more logs! We may need more sources for some use cases – Like multi-line application logs, firewall logs or even physical access logs.
  • 13. Level 8 Correlation. Manual analysis of all this new data may take too long – Correlate different sources.
  • 14. Level 9 Visual analysis.
  • 15. Next levels Pattern detection, interactive visualization, dynamic queries, anomaly detection, more sharing.
  • 16. Collecting logs Two different types.
  • 17. Type 1 Logs automatically generated from a service. For example apache2.log or mail.log – Usually huge amount of structured, but raw data. jira.graylog2.org:80 x.x.x.x - - [29/May/2011:01:47:38 +0200] "GET /browse/WEBINTERFACE-21?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel HTTP/1.1" 200 7639 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
  • 18. Type 2 Logs sent directly from within your application. Triggered for example by a log.error() call or an Exception catcher. - Possible to send structured via for example GELF 2011-05-29 18:55:51 +0200 [payment] Could not validate credit card: Got HTTP 404 from example.org
  • 19. How to send your logs Don't store the logs in flat files. Send them somewhere to get more value out of them.
  • 20. Syslog Syslog adapters for Rails are available and work pretty good.
  • 21. GELF Graylog extended log format – Let's you structure your logs. Also check out structured syslog. Ruby library, Rack exception notifier and Ruby logger available. ( www.graylog2.org )
  • 22. { ' message ':'[pay] ZOMG credit card invalid', ' full_message ':'Stacktrace.Some env vars', ' host ':'www19', ' file ':'/var/www/app.rb', ' line ':2638, ' level ':1, ' _something ':'foo', ' _something_else ':'bar' }
  • 23. AMQP Guaranteed and ordered delivery. Very flexible. Easily subscribe to the flow. Use routing keys to structure origin of the logs. Hell yeah, use this if you have an AMQP bus available. (or build one) Check out https://github.com/paukul/amqp_logging
  • 24. Throw the messages out of your app like a hot potato Loose coupling! Your logs should always leave the application without interfering it! Prefer UDP over TCP, decouple AMQP log transports. Catch all exceptions and get back into the app flow.
  • 25. Add more value to your logs For example pre-generate geo information for IP addresses or integrate the time_bandits gem.
  • 26. https://github.com/skaes/time_bandits Completed in 680.378ms (View: 28.488, DB: 5.111(2,0), MC: 5.382(6r,0m), GC: 120.100(1), HP: 0(2000000,546468,18682541,934967)) | 200 OK [ http://127.0.0.1/jobs/info ] Can generate a deep insight view of your application performance when used with LogJam: https://github.com/alpinegizmo/logjam
  • 27. Where to send your logs There are a lot of tools available.
  • 28. Hosted services: Loggly www.loggly.com Dynamic pricing based on your usage Free for 200MB/day with 1 week retention time UDP/TCP/HTTP API as input for syslog
  • 29.  
  • 30.  
  • 31. Hosted services: Splunk www.splunk.com Two license types: Free / Enterprise Supports any raw input
  • 32. Two more hosted services: www.papertrailapp.com www.logentries.com
  • 33. Open source tools: Logstash www.logstash.net Collect, parse and store logs for later use Input -> Filter -> Output Plays very well with Graylog2
  • 34. Logstash inputs For example: AMQP, file, redis, stdin, syslog, tcp, stomp, twitter
  • 35. Logstash filters For example: date, field, grep, grok, multiline
  • 36. Logstash outputs For example: amqp, elasticsearch, gelf, mongodb, redis, stdout, tcp, websocket
  • 37.  
  • 38. Open source tools: Graylog2 www.graylog2.org Accepts syslog (TCP/UDP) and GELF (+ AMQP) Rails web interface for filtering, analytics, alerting, reporting, … Stores in MongoDB
  • 39.  
  • 40.  
  • 41.  
  • 42.  
  • 43.  
  • 44. Log management use case: API consumer monitoring Something different from the usual alerting, monitoring and reporting.
  • 45. Pre-processor script (or Logstash) parses raw access log (possibly via AMQP), combines multi line log messages of API engine and extracts value.
  • 46. oauth_consumer_key, severity, http_status_code, processed (controller#action)
  • 47. Pre-processor sends the extracted value including the raw message to Graylog2.
  • 48. n.notify { :severity => 4, :short_message => “UsersController#show [500]”, :full_message => full_msg, :_oauth_consumer_key => “foo”, :_processed => “UsersController#show”, :_http_status_code => 500, ... ... }
  • 49. Now use Graylog2 and the MongoDB shell to answer questions like...
  • 50. What consumers are still using the deprecated find user by email call?
  • 51. What errors are caused by the iPhone application?
  • 52. Which applications keep causing errors?
  • 53. Which consumers are inactive?
  • 54. How many calls are done by the iPhone application and how many were it a month ago?
  • 55. Extract everything you might need from the message in a structured format you can easily parse and query later. You already have all the data you need!
  • 56. Q & A @_lennart www.lennartkoopmann.net