SlideShare a Scribd company logo
1 of 44
The Ultimate Logging Architecture 
You know you WANT it! 
Michele Leroux Bustamante 
michelebusta@solliance.net 
@michelebusta 
http://solliance.net 
http://michelebusta.com
The Hello World 
Of Logging 
1992
Hello 
World!
Hello 
World!
Logging Today 
2014
Web 
Browsers 
Mobile 
Apps 
Client 
Apps
Why do we log? 
• Troubleshooting visibility 
• Security audits, review, early detection 
• Post incident forensics 
• Track change history 
• Insights into user activity 
• Reporting and analysis
What to log? 
EXAMPLE: 
Application Events 
Windows Logs 
IIS Logs 
Trace Output 
EXAMPLE: 
Login Attempts 
Unauthorized/ 
Authorized Access 
Password Resets 
EXAMPLE: 
Session Trace 
Purchase Flow 
Report Generation 
Feature Access 
EXAMPLE: 
Change history for 
any critical system 
records 
Live Streaming / Analytics 
Event Logs Audit Logs Activity Logs History Logs
Make Logging 
EASY
Implement a Log Helper 
ILogger 
Logger 
Trace 
Debug() 
Trace 
Information() 
Trace 
Warning() 
Trace 
Error() 
Throw() 
Logger.Current.TraceInformation(); 
Logger.Current.Throw(ex);
Failure is NOT an option.
Event Logging
Just Do It 
• Whatever is built in 
• Whatever you know best 
• Just do it
Encapsulate the Mechanism 
ILogger 
Logger 
ELMAH / SLAB Azure Diagnostics log4j / log4net ElasticSearch
Audit Logging
Logs and Compliance 
• Contain no user credentials 
• No PII, PHI or identifiable user data 
• Retention period (1 year is good baseline) 
• A structured archival process 
• Alert if log reaches capacity 
• Authorized access 
• Protections from modifications (write-only)
Implement an Audit Helper 
Logger.Current.TraceInformation(); 
Logger.Current.Throw(ex); 
ILogger 
Logger 
Trace 
xxx() 
Throw() 
AuditLogger.Current.Write(); 
AuditLogger.Current.Throw(ex); 
Write() Throw() 
IAuditLogger 
AuditLogger 
Azure 
Blobs 
Event Logs Audit Logs 
DocumentDB
Benefits of noSQL 
• Log details tend to evolve 
– Schema-less storage is best 
– Re-indexing may be necessary 
• Co-location with mainline databases 
– Adds complexity and overhead (potentially) 
– Does not allow a separate “evolution” team 
around telemetry and analysis
Audit Log Use Cases 
• Every login attempt (success or failure) 
• Excessive login attempts and lockouts 
• Blocking/blacklisting users, IP addresses, access ports 
• Every logout 
• Every modification to user table, including permissions 
• All configuration changes 
• Attempts to access restricted resources, APIs from 
unexpected paths 
• All access to PII / PHI in an individually identifiable way
Audit Log Fields 
• Date/time of event 
• Machine name/instance 
• Process ID 
• User ID (possibly encrypted) / Session ID 
• Type of event 
• Success or failure of the event (if applicable) 
• Seriousness of the event violation (if applicable) 
• Message (free form) 
• Stack Trace (if applicable)
History and Activity 
Logging
History Logs 
• Changes made to key tables 
• Describes 
– Who changed the record? 
– From which application? 
– Which fields changed? 
• Need the ability to surface this to applications 
– Sometimes to users 
– Always to operations to solve problems
Implement a History Log Helper 
HistoryLogger.Current.Write(); 
IHistoryLogger 
HistoryLogger 
History Logs 
DocumentDB 
Claims 
Users 
Orders 
Claims 
Claims 
…
Wrap History in the DAL 
History Logs 
OrdersDal 
UsersDal 
ContentDal 
Relational DB 
Orders 
Claims 
Users 
Content
Wrap History in the DAL 
History Logs 
OrdersDal 
UsersDal 
ContentDal 
Relational DB 
Orders 
Claims 
Users 
Content
What happened with my order? 
History Logs 
OrdersDal 
UsersDal 
ContentDal 
Relational DB 
Orders 
Claims 
Users 
Content
Activity Logs 
• Not specific to code execution and 
troubleshooting, diagnostics 
• Specific to the application, user activity 
• COULD be informative to users as well 
– History of recent activity in the site 
– Reports they requested, downloads, other… 
• Provides insights to the business regarding 
user activity, trends and patterns 
– Non-critical analysis
Implement an Activity Log Helper 
ActivityLogger.Current.UserDownload(); 
ActivityLogger.Current.ReportRequest(); 
ActivityLogger.Current.PurchaseOrder(); 
IActivityLogger 
ActivityLogger 
Activity Logs 
DocumentDB
What happened with my order? 
History Logs 
OrdersDal 
Relational DB 
Orders 
Activity Logs
Automate Logging Where Possible 
• View controllers 
• API controllers 
• Authorization hooks 
• Outbound calls 
• Data Access layers
To Queue 
Or NOT To Queue
Client and Server Logging 
Client 
Apps 
Mobile API Client API Log API Client API Log API 
Loggers 
Web 
Browsers 
Mobile 
Apps 
Event Logs Audit Logs Activity Logs History Logs
What can I queue? 
Loggers 
ETW 
DocDB 
Event Logs Audit Logs Activity Logs History Logs
ETW Goal 
Loggers 
ETW 
History 
Publisher 
Activity 
Publisher 
Audit 
Publisher 
ALERTS 
Stream 
Analytics 
Events 
Publisher 
Event Logs Audit Logs Activity Logs History Logs
Queued Logging 
• Considerations 
– Timestamps matter 
– Correlation across nodes matters (to a point) 
– Guaranteed exactly one in order doesn’t exist 
– Async is good (mostly) 
• That said 
– Priority matters (hot, warm, default) 
– Simplicity matters 
– Throughput matters
Troubleshooting 
Is Important!
Problem Statement 
• We need immediate access to what the HECK 
is going on when there is a problem 
• Sometimes I use (in order): 
– Google Analytics 
– Event Logs (Azure Website) 
– Table Storage queries (STRIKE THAT, USELESS) 
– Blob storage CSVs (good enough, not realtime)
Elasticsearch Architecture 
Logger AuditLogger HistoryLogger ActivityLogger 
Elasticsearch
Kibana Visualization
LogStash 
LogStash 
Elasticsearch 
Identity Server Web Server / IIS / 
Event Logs 
CPU / Memory 
Perf Counters 
Blob CSVs …
Archives, Aggregation 
and Analytics
ARCHIVE 
Elastic Search 
Audit Logs 
Activity Logs 
History Logs 
HDInsight 
PoweShell 
Spin up, analyze, spin down 
Ingest 
Blob 
Storage 
Event Logs 
OR, just…
What you’re looking for is… 
• Manageable implementation 
• Ability to “evolve” log content 
• Reduce IO / socket overhead (monitor this) 
• Prioritization 
• Real-time analytics, troubleshooting 
• Accessibility for UI lookups (history, activity) 
• Archival and mass analysis
References 
• Conference resources: 
– http://michelebusta.com 
• Contact me: 
– michelebusta@solliance.net 
– @michelebusta 
• Founder, CIO of Solliance 
– http://solliance.net

More Related Content

What's hot

Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
Amazon Web Services
 
Kappa vs Lambda Architectures and Technology Comparison
Kappa vs Lambda Architectures and Technology ComparisonKappa vs Lambda Architectures and Technology Comparison
Kappa vs Lambda Architectures and Technology Comparison
Kai Wähner
 

What's hot (20)

Communication in a Microservice Architecture
Communication in a Microservice ArchitectureCommunication in a Microservice Architecture
Communication in a Microservice Architecture
 
Jitney, Kafka at Airbnb
Jitney, Kafka at AirbnbJitney, Kafka at Airbnb
Jitney, Kafka at Airbnb
 
Flink Forward Berlin 2017: Aris Kyriakos Koliopoulos - Drivetribe's Kappa Arc...
Flink Forward Berlin 2017: Aris Kyriakos Koliopoulos - Drivetribe's Kappa Arc...Flink Forward Berlin 2017: Aris Kyriakos Koliopoulos - Drivetribe's Kappa Arc...
Flink Forward Berlin 2017: Aris Kyriakos Koliopoulos - Drivetribe's Kappa Arc...
 
Common issues with Apache Kafka® Producer
Common issues with Apache Kafka® ProducerCommon issues with Apache Kafka® Producer
Common issues with Apache Kafka® Producer
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
 
Data Infra and Data Access in Nubank
Data Infra and Data Access in NubankData Infra and Data Access in Nubank
Data Infra and Data Access in Nubank
 
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
 
RedisConf18 - 2,000 Instances and Beyond
RedisConf18 - 2,000 Instances and BeyondRedisConf18 - 2,000 Instances and Beyond
RedisConf18 - 2,000 Instances and Beyond
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
Kafka Summit SF 2017 - Best Practices for Running Kafka on Docker Containers
Kafka Summit SF 2017 - Best Practices for Running Kafka on Docker ContainersKafka Summit SF 2017 - Best Practices for Running Kafka on Docker Containers
Kafka Summit SF 2017 - Best Practices for Running Kafka on Docker Containers
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
SRV405 Deep Dive Amazon Redshift & Redshift Spectrum at Cardinal Health
SRV405 Deep Dive Amazon Redshift & Redshift Spectrum at Cardinal HealthSRV405 Deep Dive Amazon Redshift & Redshift Spectrum at Cardinal Health
SRV405 Deep Dive Amazon Redshift & Redshift Spectrum at Cardinal Health
 
Apache Druid 101
Apache Druid 101Apache Druid 101
Apache Druid 101
 
Kappa vs Lambda Architectures and Technology Comparison
Kappa vs Lambda Architectures and Technology ComparisonKappa vs Lambda Architectures and Technology Comparison
Kappa vs Lambda Architectures and Technology Comparison
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova...
Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova...Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova...
Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova...
 
Optimising Geospatial Queries with Dynamic File Pruning
Optimising Geospatial Queries with Dynamic File PruningOptimising Geospatial Queries with Dynamic File Pruning
Optimising Geospatial Queries with Dynamic File Pruning
 
Performance Troubleshooting Using Apache Spark Metrics
Performance Troubleshooting Using Apache Spark MetricsPerformance Troubleshooting Using Apache Spark Metrics
Performance Troubleshooting Using Apache Spark Metrics
 

Viewers also liked

Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
amiable_indian
 
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
DataWorks Summit
 

Viewers also liked (20)

Elastic search overview
Elastic search overviewElastic search overview
Elastic search overview
 
Combine Apache Hadoop and Elasticsearch to Get the Most of Your Big Data
Combine Apache Hadoop and Elasticsearch to Get the Most of Your Big DataCombine Apache Hadoop and Elasticsearch to Get the Most of Your Big Data
Combine Apache Hadoop and Elasticsearch to Get the Most of Your Big Data
 
Introduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperIntroduction to Kafka and Zookeeper
Introduction to Kafka and Zookeeper
 
Centralized + Unified Logging
Centralized + Unified LoggingCentralized + Unified Logging
Centralized + Unified Logging
 
Java logging
Java loggingJava logging
Java logging
 
SLF4J+Logback
SLF4J+LogbackSLF4J+Logback
SLF4J+Logback
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
Docker Logging Webinar
Docker Logging  WebinarDocker Logging  Webinar
Docker Logging Webinar
 
Intro to Elasticsearch
Intro to ElasticsearchIntro to Elasticsearch
Intro to Elasticsearch
 
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
Realtime Analytics and Anomalities Detection using Elasticsearch, Hadoop and ...
 
Spark 101 - First steps to distributed computing
Spark 101 - First steps to distributed computingSpark 101 - First steps to distributed computing
Spark 101 - First steps to distributed computing
 
Big Data and Analytics – End to End on AWS – Russell Nash
Big Data and Analytics – End to End on AWS – Russell NashBig Data and Analytics – End to End on AWS – Russell Nash
Big Data and Analytics – End to End on AWS – Russell Nash
 
The basics of fluentd
The basics of fluentdThe basics of fluentd
The basics of fluentd
 
Introduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of LuceneIntroduction to Elasticsearch with basics of Lucene
Introduction to Elasticsearch with basics of Lucene
 
Real time analytics using Hadoop and Elasticsearch
Real time analytics using Hadoop and ElasticsearchReal time analytics using Hadoop and Elasticsearch
Real time analytics using Hadoop and Elasticsearch
 
Fluentd and Kafka
Fluentd and KafkaFluentd and Kafka
Fluentd and Kafka
 
Data Science with Spark & Zeppelin
Data Science with Spark & ZeppelinData Science with Spark & Zeppelin
Data Science with Spark & Zeppelin
 
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17Deep Dive with Spark Streaming - Tathagata  Das - Spark Meetup 2013-06-17
Deep Dive with Spark Streaming - Tathagata Das - Spark Meetup 2013-06-17
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafka
 
Capgemini Insights and Data
Capgemini Insights and Data Capgemini Insights and Data
Capgemini Insights and Data
 

Similar to The Ultimate Logging Architecture - You KNOW you want it!

Monitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the companyMonitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the company
Jeff Weinstein
 

Similar to The Ultimate Logging Architecture - You KNOW you want it! (20)

Security Practices - Logging.pptx
Security Practices - Logging.pptxSecurity Practices - Logging.pptx
Security Practices - Logging.pptx
 
Cashing in on logging and exception data
Cashing in on logging and exception dataCashing in on logging and exception data
Cashing in on logging and exception data
 
Technology behind-real-time-log-analytics
Technology behind-real-time-log-analytics Technology behind-real-time-log-analytics
Technology behind-real-time-log-analytics
 
Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?
 
Logging service design
Logging service designLogging service design
Logging service design
 
State of the art logging
State of the art loggingState of the art logging
State of the art logging
 
Audit logging
Audit loggingAudit logging
Audit logging
 
Alfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azureAlfredo Reino - Monitoring aws and azure
Alfredo Reino - Monitoring aws and azure
 
Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16
 
Server Log Files & Technical SEO Audits: What You Need to Know
Server Log Files & Technical SEO Audits: What You Need to KnowServer Log Files & Technical SEO Audits: What You Need to Know
Server Log Files & Technical SEO Audits: What You Need to Know
 
Choosing Your Log Management Approach: Buy, Build or Outsource
Choosing Your Log Management Approach: Buy, Build or OutsourceChoosing Your Log Management Approach: Buy, Build or Outsource
Choosing Your Log Management Approach: Buy, Build or Outsource
 
Softwerkskammer Lübeck 08/2018 Event Sourcing and CQRS
Softwerkskammer Lübeck 08/2018 Event Sourcing and CQRSSoftwerkskammer Lübeck 08/2018 Event Sourcing and CQRS
Softwerkskammer Lübeck 08/2018 Event Sourcing and CQRS
 
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User GroupWhat is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
 
Instrumentation of Software Systems
Instrumentation of Software SystemsInstrumentation of Software Systems
Instrumentation of Software Systems
 
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
 
Try {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks
Try {stuff} Catch {hopefully not} - Evading Detection & Covering TracksTry {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks
Try {stuff} Catch {hopefully not} - Evading Detection & Covering Tracks
 
Building a reliable and cost effect logging system at Box
Building a reliable and cost effect logging system at Box Building a reliable and cost effect logging system at Box
Building a reliable and cost effect logging system at Box
 
Monitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the companyMonitorama: How monitoring can improve the rest of the company
Monitorama: How monitoring can improve the rest of the company
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An Introduction
 
Campus days 2013 - Instrumentation
Campus days 2013 - InstrumentationCampus days 2013 - Instrumentation
Campus days 2013 - Instrumentation
 

More from Michele Leroux Bustamante

More from Michele Leroux Bustamante (18)

So Many Docker Platforms...so little time
So Many Docker Platforms...so little timeSo Many Docker Platforms...so little time
So Many Docker Platforms...so little time
 
Surviving Microservices - v2
Surviving Microservices - v2Surviving Microservices - v2
Surviving Microservices - v2
 
.NET Developer Days - Launching Patterns for Containers
.NET Developer Days - Launching Patterns for Containers.NET Developer Days - Launching Patterns for Containers
.NET Developer Days - Launching Patterns for Containers
 
.NET Developer Days - So many Docker platforms, so little time...
.NET Developer Days - So many Docker platforms, so little time....NET Developer Days - So many Docker platforms, so little time...
.NET Developer Days - So many Docker platforms, so little time...
 
Design Practices for a Secure Azure Solution
Design Practices for a Secure Azure SolutionDesign Practices for a Secure Azure Solution
Design Practices for a Secure Azure Solution
 
The Power of Social Login
The Power of Social LoginThe Power of Social Login
The Power of Social Login
 
Unleash Your Inner Startup (Sweden, Dev Sum)
Unleash Your Inner Startup (Sweden, Dev Sum)Unleash Your Inner Startup (Sweden, Dev Sum)
Unleash Your Inner Startup (Sweden, Dev Sum)
 
Deep thoughts from the real world of azure
Deep thoughts from the real world of azureDeep thoughts from the real world of azure
Deep thoughts from the real world of azure
 
Social Login
Social LoginSocial Login
Social Login
 
Security Avalanche
Security AvalancheSecurity Avalanche
Security Avalanche
 
Surviving the Azure Avalanche
Surviving the Azure AvalancheSurviving the Azure Avalanche
Surviving the Azure Avalanche
 
DevOps for Azure
DevOps for AzureDevOps for Azure
DevOps for Azure
 
End to End Security with MVC and Web API
End to End Security with MVC and Web APIEnd to End Security with MVC and Web API
End to End Security with MVC and Web API
 
Windows Azure Essentials V3
Windows Azure Essentials V3Windows Azure Essentials V3
Windows Azure Essentials V3
 
Channel Your Inner Startup and Go For It!
Channel Your Inner Startup and Go For It!Channel Your Inner Startup and Go For It!
Channel Your Inner Startup and Go For It!
 
Global Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San DiegoGlobal Windows Azure Bootcamp - San Diego
Global Windows Azure Bootcamp - San Diego
 
Windows Azure Essentials
Windows Azure EssentialsWindows Azure Essentials
Windows Azure Essentials
 
Pricing and Revenue Projection in a Cloud-Centric World
Pricing and Revenue Projection in a Cloud-Centric WorldPricing and Revenue Projection in a Cloud-Centric World
Pricing and Revenue Projection in a Cloud-Centric World
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

The Ultimate Logging Architecture - You KNOW you want it!

  • 1. The Ultimate Logging Architecture You know you WANT it! Michele Leroux Bustamante michelebusta@solliance.net @michelebusta http://solliance.net http://michelebusta.com
  • 2. The Hello World Of Logging 1992
  • 6. Web Browsers Mobile Apps Client Apps
  • 7. Why do we log? • Troubleshooting visibility • Security audits, review, early detection • Post incident forensics • Track change history • Insights into user activity • Reporting and analysis
  • 8. What to log? EXAMPLE: Application Events Windows Logs IIS Logs Trace Output EXAMPLE: Login Attempts Unauthorized/ Authorized Access Password Resets EXAMPLE: Session Trace Purchase Flow Report Generation Feature Access EXAMPLE: Change history for any critical system records Live Streaming / Analytics Event Logs Audit Logs Activity Logs History Logs
  • 10. Implement a Log Helper ILogger Logger Trace Debug() Trace Information() Trace Warning() Trace Error() Throw() Logger.Current.TraceInformation(); Logger.Current.Throw(ex);
  • 11. Failure is NOT an option.
  • 13. Just Do It • Whatever is built in • Whatever you know best • Just do it
  • 14. Encapsulate the Mechanism ILogger Logger ELMAH / SLAB Azure Diagnostics log4j / log4net ElasticSearch
  • 16. Logs and Compliance • Contain no user credentials • No PII, PHI or identifiable user data • Retention period (1 year is good baseline) • A structured archival process • Alert if log reaches capacity • Authorized access • Protections from modifications (write-only)
  • 17. Implement an Audit Helper Logger.Current.TraceInformation(); Logger.Current.Throw(ex); ILogger Logger Trace xxx() Throw() AuditLogger.Current.Write(); AuditLogger.Current.Throw(ex); Write() Throw() IAuditLogger AuditLogger Azure Blobs Event Logs Audit Logs DocumentDB
  • 18. Benefits of noSQL • Log details tend to evolve – Schema-less storage is best – Re-indexing may be necessary • Co-location with mainline databases – Adds complexity and overhead (potentially) – Does not allow a separate “evolution” team around telemetry and analysis
  • 19. Audit Log Use Cases • Every login attempt (success or failure) • Excessive login attempts and lockouts • Blocking/blacklisting users, IP addresses, access ports • Every logout • Every modification to user table, including permissions • All configuration changes • Attempts to access restricted resources, APIs from unexpected paths • All access to PII / PHI in an individually identifiable way
  • 20. Audit Log Fields • Date/time of event • Machine name/instance • Process ID • User ID (possibly encrypted) / Session ID • Type of event • Success or failure of the event (if applicable) • Seriousness of the event violation (if applicable) • Message (free form) • Stack Trace (if applicable)
  • 22. History Logs • Changes made to key tables • Describes – Who changed the record? – From which application? – Which fields changed? • Need the ability to surface this to applications – Sometimes to users – Always to operations to solve problems
  • 23. Implement a History Log Helper HistoryLogger.Current.Write(); IHistoryLogger HistoryLogger History Logs DocumentDB Claims Users Orders Claims Claims …
  • 24. Wrap History in the DAL History Logs OrdersDal UsersDal ContentDal Relational DB Orders Claims Users Content
  • 25. Wrap History in the DAL History Logs OrdersDal UsersDal ContentDal Relational DB Orders Claims Users Content
  • 26. What happened with my order? History Logs OrdersDal UsersDal ContentDal Relational DB Orders Claims Users Content
  • 27. Activity Logs • Not specific to code execution and troubleshooting, diagnostics • Specific to the application, user activity • COULD be informative to users as well – History of recent activity in the site – Reports they requested, downloads, other… • Provides insights to the business regarding user activity, trends and patterns – Non-critical analysis
  • 28. Implement an Activity Log Helper ActivityLogger.Current.UserDownload(); ActivityLogger.Current.ReportRequest(); ActivityLogger.Current.PurchaseOrder(); IActivityLogger ActivityLogger Activity Logs DocumentDB
  • 29. What happened with my order? History Logs OrdersDal Relational DB Orders Activity Logs
  • 30. Automate Logging Where Possible • View controllers • API controllers • Authorization hooks • Outbound calls • Data Access layers
  • 31. To Queue Or NOT To Queue
  • 32. Client and Server Logging Client Apps Mobile API Client API Log API Client API Log API Loggers Web Browsers Mobile Apps Event Logs Audit Logs Activity Logs History Logs
  • 33. What can I queue? Loggers ETW DocDB Event Logs Audit Logs Activity Logs History Logs
  • 34. ETW Goal Loggers ETW History Publisher Activity Publisher Audit Publisher ALERTS Stream Analytics Events Publisher Event Logs Audit Logs Activity Logs History Logs
  • 35. Queued Logging • Considerations – Timestamps matter – Correlation across nodes matters (to a point) – Guaranteed exactly one in order doesn’t exist – Async is good (mostly) • That said – Priority matters (hot, warm, default) – Simplicity matters – Throughput matters
  • 37. Problem Statement • We need immediate access to what the HECK is going on when there is a problem • Sometimes I use (in order): – Google Analytics – Event Logs (Azure Website) – Table Storage queries (STRIKE THAT, USELESS) – Blob storage CSVs (good enough, not realtime)
  • 38. Elasticsearch Architecture Logger AuditLogger HistoryLogger ActivityLogger Elasticsearch
  • 40. LogStash LogStash Elasticsearch Identity Server Web Server / IIS / Event Logs CPU / Memory Perf Counters Blob CSVs …
  • 42. ARCHIVE Elastic Search Audit Logs Activity Logs History Logs HDInsight PoweShell Spin up, analyze, spin down Ingest Blob Storage Event Logs OR, just…
  • 43. What you’re looking for is… • Manageable implementation • Ability to “evolve” log content • Reduce IO / socket overhead (monitor this) • Prioritization • Real-time analytics, troubleshooting • Accessibility for UI lookups (history, activity) • Archival and mass analysis
  • 44. References • Conference resources: – http://michelebusta.com • Contact me: – michelebusta@solliance.net – @michelebusta • Founder, CIO of Solliance – http://solliance.net

Editor's Notes

  1. 1
  2. Visibility into runtime behavior for troubleshooting or analysis Early detection of security incidents, identification of potential threats Forensic analysis to discover the cause of events, and ways to avoid them in future with software controls or other means General business intelligence and analysis of user and system behavior
  3. ----- Meeting Notes (12/3/14 07:53) ----- it starts to look like a lot of work... so, if I could impart one message up front it would be this
  4. Add heavy lifting guy ----- Meeting Notes (12/3/14 07:53) ----- assume your devs are stupid and lazy
  5. ----- Meeting Notes (12/3/14 05:45) ----- with this we can litter our code with verbose logs
  6. Example, migration to cloud, risky to add logs, risky not to have them ----- Meeting Notes (12/3/14 07:53) ----- DEMO 1 - show that logging code
  7. Add heavy lifting guy ----- Meeting Notes (12/3/14 05:45) ----- so we have a wrapper class it starts with basic event logging sts, wrote to event log, etw trace, event source today cloud, use what comes naturally
  8. Without it, you have no visibility If trying to “get it right” is preventing you from logging, you’re already in trouble Just log, worry about improvements later
  9. We don’t know how you do it We don’t care how you do it We do need to know where it goes (devops)
  10. Add heavy lifting guy
  11. The technical details will be platform dependent Inheritance Dependency injection, these are details The point is, auditing is intentional; you call it out It goes to a different place;
  12. ----- Meeting Notes (12/3/14 07:53) ----- DEMO 2 - show doc db classes, show results add a field?
  13. ----- Meeting Notes (12/3/14 07:53) ----- these logs are only good if you actually review them
  14. Add heavy lifting guy
  15. ----- Meeting Notes (12/3/14 07:59) ----- sql logs not helpful to surface to apps helpful for forensics, not accessible to many
  16. ----- Meeting Notes (12/3/14 07:59) ----- DEMO 3 - ??? look at history? any object works?
  17. Add heavy lifting guy
  18. You are collecting logs Now what, site is down, how do you know what’s up? What kinds of exceptions are being thrown? Where in the code are there uncaught exceptions tossing up the chain? Are you catching and logging those?
  19. You are collecting logs Now what, site is down, how do you know what’s up? What kinds of exceptions are being thrown? Where in the code are there uncaught exceptions tossing up the chain? Are you catching and logging those?