SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Logging For Fun and Profit

                                    Jane Prusakova

               Jane.Prusakova@ImprovingEnter
                           prises.com
               http://softwareandotherthings.blog
                            spot.com
                                    Improving Enterprises
                                      Houston TechFest
                                         09/08/2012
©2010 Improving Enterprises, Inc.
Why
        How-to
        Using the results


©2010 Improving Enterprises, Inc.
Why logging?
Enquiring minds want to know!
 Avoid programming-by-coincidence
 Trace what the users do
 See effects of
              Integration
              Multithreading
              High load

©2010 Improving Enterprises, Inc.
When to use logging?
      Greenfield development
      Brownfield development
              what came before
              the effect of changes
      Maintenance and troubleshooting
              trace bugs
      Bonus
              Evolve apps based on users behavior


©2010 Improving Enterprises, Inc.
Logging vs Debugging
       Set up once, always ready to use
       Minimum disruption to the flow
       Works locally and in the cloud
       Faster data collection
       Collected data is persisted



©2010 Improving Enterprises, Inc.
How-to
        Using the results


©2010 Improving Enterprises, Inc.
Yes, I want to setup logging!

      Pick a framework

      Proper configuration

      Consider ways to parse logs

      Logging will change with the application




©2010 Improving Enterprises, Inc.
Frameworks
                Log4net                      Nlog
                    Apache                    BSD

              Logs arrays                Integrates with
                                            MSMQ
     Configuration, log levels and categories,
       rotate log files, thread-safe logging.

     Support: online documentation, tutorials,
                  online forums.

©2010 Improving Enterprises, Inc.
Planning and Strategy
      Enough and but not too much
      Preserve
              correctness
              readability of the code
              performance




©2010 Improving Enterprises, Inc.
Planning and Strategy (contd.)

             Database                     Files
          Easy to parse,            Very hard to parse,
          hard to evolve             easy to change
            Uses DB                    Requires FS
           connections                    access

        Can cause app                Can fill up space
            crash



©2010 Improving Enterprises, Inc.
Best Practices
      Relate each message to generating point
              Code

                Data

      Format messages for readability

      Define .ToString on objects



©2010 Improving Enterprises, Inc.
More Best Practices

        Input and output
        Errors and exceptions
        Transitions
        Integration points
        Thread rendezvous

©2010 Improving Enterprises, Inc.
Practices to avoid
      Little information
       … // step 1
       Logger.info(“did something”);
       … // ste 2
       Logger.info(“did more work”);
       foreach (…) {
              … // useful work
       Logger.info(“working hard”);
       }


©2010 Improving Enterprises, Inc.
Practices to avoid (contd.)

       Long and boring




©2010 Improving Enterprises, Inc.
Practices to avoid (contd.)
      Side effects
      Logger.info(count++ “: did something”);

      Errors and exceptions
       Logger.info(m.GetValue());




©2010 Improving Enterprises, Inc.
Using the results




©2010 Improving Enterprises, Inc.
You’ve got logs!
      Rotate logs: by size, by time
              Retention policy
              2-level storage

      Provide access - read only!
      Transfer and analysis
              Warning: large datasets


©2010 Improving Enterprises, Inc.
Security and performance

                                    Moving and processing

                                    can impact performance

                                    Absolutely no sensitive
                                    data



©2010 Improving Enterprises, Inc.
Learning from the logs

                                    Never rely on eye-balling
                                      WYS is not WYG

                                      Aggregate data

                                    Distinguish common and
                                    rare


©2010 Improving Enterprises, Inc.
Tools
Process datasets:

       line by line
              grep, Perl, awk, cut, tail, head
       with less memory
              vi, notepad++

©2010 Improving Enterprises, Inc.
Logging For Fun and Profit

                                    Jane Prusakova

               Jane.Prusakova@ImprovingEnter
                           prises.com
               http://softwareandotherthings.blog
                            spot.com
                                    Improving Enterprises
                                      Houston TechFest
                                         09/08/2012
©2010 Improving Enterprises, Inc.
Upcoming Public Classes
        Object Oriented Design and Test Driven Development
                     Oct. 1st – Oct. 4th
      Agile Development with TFS
                     Oct. 8th – Oct. 11th
      Professional Scrum Master
                     Oct. 16th – Oct. 17th
      Agile QA with TFS
                     Oct. 24th – 26th

      Interested?
              Email training@improvingenterprises.com

©2010 Improving Enterprises, Inc.
Lunch and Learns / Assessments
         Lunch and Learns
              Have an Improver come to speak with your
              team on conceptual topics more targeted to
              your environment.
      Assessments
              Have an Improver assess your environment
              and lend some experience on technical
              topics.
      Interested? Contact –
      devlin.liles@improvingenterprises.com

©2010 Improving Enterprises, Inc.
Make it Happen in the Cloud:
           Windows Azure Developer Camp
      We will start with the basics and build on to more
      advanced topics, featuring hands-on labs for:
              Windows Azure Cloud Services
              Windows Azure SQL Database
              Windows Azure Virtual Machines
              Windows Azure Access Control Services
              Service Remoteing with Windows Azure Service Bus

      Presented by: Improving Enterprises
      When: October 22, 2012 9am-5pm
      Where: Microsoft Office Houston
      Registration: http://bit.ly/ImprovingAzure

©2010 Improving Enterprises, Inc.

Weitere ähnliche Inhalte

Was ist angesagt?

Slow and dirty with callouts
Slow and dirty with calloutsSlow and dirty with callouts
Slow and dirty with callouts
AgileOnTheBeach
 
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTPSession 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
Purnama Anaking
 
Intalio works japan seminar
Intalio works   japan seminarIntalio works   japan seminar
Intalio works japan seminar
Tomoaki Sawada
 
Itsmf itil 2011 demo
Itsmf itil 2011 demoItsmf itil 2011 demo
Itsmf itil 2011 demo
itSMFThailand
 

Was ist angesagt? (19)

Slow and dirty with callouts
Slow and dirty with calloutsSlow and dirty with callouts
Slow and dirty with callouts
 
JAX2010 Flex Java technical session: interactive dashboard
JAX2010 Flex Java technical session: interactive dashboardJAX2010 Flex Java technical session: interactive dashboard
JAX2010 Flex Java technical session: interactive dashboard
 
Sentri's Microsoft Cloud Webinar
Sentri's Microsoft Cloud WebinarSentri's Microsoft Cloud Webinar
Sentri's Microsoft Cloud Webinar
 
The Agile CVD Test
The Agile CVD TestThe Agile CVD Test
The Agile CVD Test
 
OCSL - Microsoft System Center & Windows Server 2012 webinar March 2012
OCSL - Microsoft System Center & Windows Server 2012 webinar March 2012 OCSL - Microsoft System Center & Windows Server 2012 webinar March 2012
OCSL - Microsoft System Center & Windows Server 2012 webinar March 2012
 
Webinar: Move Your Business Forward with Cisco VOIP for SMB
Webinar: Move Your Business Forward with Cisco VOIP for SMBWebinar: Move Your Business Forward with Cisco VOIP for SMB
Webinar: Move Your Business Forward with Cisco VOIP for SMB
 
Adobe flash platform java
Adobe flash platform javaAdobe flash platform java
Adobe flash platform java
 
STKI Summit 2010 Infra Pini
STKI Summit 2010 Infra PiniSTKI Summit 2010 Infra Pini
STKI Summit 2010 Infra Pini
 
Klimenok telepresence
Klimenok telepresenceKlimenok telepresence
Klimenok telepresence
 
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTPSession 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
Session 2 - E Business Basic Infrastructure # Subversion, Hosting, Domain, FTP
 
cfactor Social Business Solutions
cfactor Social Business Solutionscfactor Social Business Solutions
cfactor Social Business Solutions
 
Intalio works japan seminar
Intalio works   japan seminarIntalio works   japan seminar
Intalio works japan seminar
 
Eye Track Shop General Presentation Linked In
Eye Track Shop General Presentation Linked InEye Track Shop General Presentation Linked In
Eye Track Shop General Presentation Linked In
 
Invest In Smarter Collaboration Final V2
Invest In Smarter Collaboration Final V2Invest In Smarter Collaboration Final V2
Invest In Smarter Collaboration Final V2
 
Itsmf itil 2011 demo
Itsmf itil 2011 demoItsmf itil 2011 demo
Itsmf itil 2011 demo
 
NLJUG: Content Management, Standards, Opensource & JCP
NLJUG: Content Management, Standards, Opensource & JCPNLJUG: Content Management, Standards, Opensource & JCP
NLJUG: Content Management, Standards, Opensource & JCP
 
Identifying design requeriments
Identifying design requerimentsIdentifying design requeriments
Identifying design requeriments
 
Velocity Technology Solutions Overview
Velocity Technology Solutions OverviewVelocity Technology Solutions Overview
Velocity Technology Solutions Overview
 
How cloud is transforming business and IT?
How cloud is transforming business and IT?How cloud is transforming business and IT?
How cloud is transforming business and IT?
 

Andere mochten auch

Application logging for fun and profit
Application logging for fun and profitApplication logging for fun and profit
Application logging for fun and profit
Jane Prusakova
 

Andere mochten auch (15)

Application logging for fun and profit
Application logging for fun and profitApplication logging for fun and profit
Application logging for fun and profit
 
What is good code?
What is good code?What is good code?
What is good code?
 
Pragmatic Agile: distributed teams
Pragmatic Agile: distributed teamsPragmatic Agile: distributed teams
Pragmatic Agile: distributed teams
 
Lets talk About Good Code (Dallas TechFest 2014)
Lets talk About Good Code (Dallas TechFest 2014)Lets talk About Good Code (Dallas TechFest 2014)
Lets talk About Good Code (Dallas TechFest 2014)
 
The power of nudge. Building great teams.
The power of nudge. Building great teams. The power of nudge. Building great teams.
The power of nudge. Building great teams.
 
A case for remote teams
A case for remote teamsA case for remote teams
A case for remote teams
 
Effective Code Review
Effective Code ReviewEffective Code Review
Effective Code Review
 
Motivating Knowledge Workers
Motivating Knowledge WorkersMotivating Knowledge Workers
Motivating Knowledge Workers
 
Privacy In The Digital Age
Privacy In The Digital AgePrivacy In The Digital Age
Privacy In The Digital Age
 
Women in Technology. Things that hold women back.
Women in Technology. Things that hold women back. Women in Technology. Things that hold women back.
Women in Technology. Things that hold women back.
 
Building great teams: the power of a nudge.
Building great teams: the power of a nudge.  Building great teams: the power of a nudge.
Building great teams: the power of a nudge.
 
Application Logging for large systems
Application Logging for large systemsApplication Logging for large systems
Application Logging for large systems
 
Interview: a Learning Conversation
Interview: a Learning ConversationInterview: a Learning Conversation
Interview: a Learning Conversation
 
Lets talk about good code
Lets talk about good codeLets talk about good code
Lets talk about good code
 
Effective Code Review
Effective Code ReviewEffective Code Review
Effective Code Review
 

Ähnlich wie Application Logging for fun and profit. Houston TechFest 2012

Accenture and OpenStack
Accenture and OpenStackAccenture and OpenStack
Accenture and OpenStack
Open Stack
 
Demo Slides: Application Release Automation with Deployit
Demo Slides: Application Release Automation with DeployitDemo Slides: Application Release Automation with Deployit
Demo Slides: Application Release Automation with Deployit
XebiaLabs
 
Application Quality with Visual Studio 2010
Application Quality with Visual Studio 2010Application Quality with Visual Studio 2010
Application Quality with Visual Studio 2010
Anna Russo
 
Performance Management In The New Frontier Of Rich Internet Applications
Performance Management In The New Frontier Of Rich Internet ApplicationsPerformance Management In The New Frontier Of Rich Internet Applications
Performance Management In The New Frontier Of Rich Internet Applications
Ben Rushlo
 

Ähnlich wie Application Logging for fun and profit. Houston TechFest 2012 (20)

Building a great team: power of a nudge.
Building a great team: power of a nudge.Building a great team: power of a nudge.
Building a great team: power of a nudge.
 
Boeing Webinar - Integrating Quality in Portfolio Management - oct 2010
Boeing Webinar - Integrating Quality in Portfolio Management -  oct 2010Boeing Webinar - Integrating Quality in Portfolio Management -  oct 2010
Boeing Webinar - Integrating Quality in Portfolio Management - oct 2010
 
Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]
 
VS TFS 2010 - Part1
VS TFS 2010 - Part1VS TFS 2010 - Part1
VS TFS 2010 - Part1
 
Windows Azure overview webinar by Sentri
Windows Azure overview webinar by SentriWindows Azure overview webinar by Sentri
Windows Azure overview webinar by Sentri
 
How to Make the Business Case for a CMS in Your Organization
How to Make the Business Case for a CMS in Your OrganizationHow to Make the Business Case for a CMS in Your Organization
How to Make the Business Case for a CMS in Your Organization
 
Accenture and OpenStack
Accenture and OpenStackAccenture and OpenStack
Accenture and OpenStack
 
Flex and the city in London - Keynote
Flex and the city in London - KeynoteFlex and the city in London - Keynote
Flex and the city in London - Keynote
 
Does DITA need XML?
Does DITA need XML?Does DITA need XML?
Does DITA need XML?
 
Start > Automate > Create | Book Publishing in the Cloud
Start > Automate > Create | Book Publishing in the CloudStart > Automate > Create | Book Publishing in the Cloud
Start > Automate > Create | Book Publishing in the Cloud
 
Demo Slides: Application Release Automation with Deployit
Demo Slides: Application Release Automation with DeployitDemo Slides: Application Release Automation with Deployit
Demo Slides: Application Release Automation with Deployit
 
Application Quality with Visual Studio 2010
Application Quality with Visual Studio 2010Application Quality with Visual Studio 2010
Application Quality with Visual Studio 2010
 
XebiaLabs Overview Slides
XebiaLabs Overview SlidesXebiaLabs Overview Slides
XebiaLabs Overview Slides
 
Performance Management In The New Frontier Of Rich Internet Applications
Performance Management In The New Frontier Of Rich Internet ApplicationsPerformance Management In The New Frontier Of Rich Internet Applications
Performance Management In The New Frontier Of Rich Internet Applications
 
Gtl Corporate Presentation
Gtl Corporate PresentationGtl Corporate Presentation
Gtl Corporate Presentation
 
TIRTA ERP
TIRTA ERPTIRTA ERP
TIRTA ERP
 
Saa s webinar slides final rlh - 3-31
Saa s webinar slides   final rlh - 3-31Saa s webinar slides   final rlh - 3-31
Saa s webinar slides final rlh - 3-31
 
Integrating Quality into Portfolio Management
Integrating Quality into Portfolio Management Integrating Quality into Portfolio Management
Integrating Quality into Portfolio Management
 
Cost Plus Pricing
Cost Plus PricingCost Plus Pricing
Cost Plus Pricing
 
DevOps in Practice: When does "Practice" Become "Doing"?
DevOps in Practice: When does "Practice" Become "Doing"?DevOps in Practice: When does "Practice" Become "Doing"?
DevOps in Practice: When does "Practice" Become "Doing"?
 

Mehr von Jane Prusakova

Mehr von Jane Prusakova (13)

Software architecture houstontechfest2020
Software architecture houstontechfest2020Software architecture houstontechfest2020
Software architecture houstontechfest2020
 
Estimating software development
Estimating software developmentEstimating software development
Estimating software development
 
Better remote teams
Better remote teamsBetter remote teams
Better remote teams
 
Thoughts on building software architecture
Thoughts on building software architectureThoughts on building software architecture
Thoughts on building software architecture
 
Improving IT Performance
Improving IT PerformanceImproving IT Performance
Improving IT Performance
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software Development
 
Questions of Ethics in Software Development
Questions of Ethics in Software DevelopmentQuestions of Ethics in Software Development
Questions of Ethics in Software Development
 
Just startcoding
Just startcodingJust startcoding
Just startcoding
 
Just start coding
Just start codingJust start coding
Just start coding
 
Good code
Good codeGood code
Good code
 
Managing remote teams.
Managing remote teams.Managing remote teams.
Managing remote teams.
 
Gender-neutral Recruiting
Gender-neutral RecruitingGender-neutral Recruiting
Gender-neutral Recruiting
 
Running Java safely
Running Java safelyRunning Java safely
Running Java safely
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your 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)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Application Logging for fun and profit. Houston TechFest 2012

  • 1. Logging For Fun and Profit Jane Prusakova Jane.Prusakova@ImprovingEnter prises.com http://softwareandotherthings.blog spot.com Improving Enterprises Houston TechFest 09/08/2012 ©2010 Improving Enterprises, Inc.
  • 2. Why How-to Using the results ©2010 Improving Enterprises, Inc.
  • 3. Why logging? Enquiring minds want to know! Avoid programming-by-coincidence Trace what the users do See effects of Integration Multithreading High load ©2010 Improving Enterprises, Inc.
  • 4. When to use logging? Greenfield development Brownfield development what came before the effect of changes Maintenance and troubleshooting trace bugs Bonus Evolve apps based on users behavior ©2010 Improving Enterprises, Inc.
  • 5. Logging vs Debugging Set up once, always ready to use Minimum disruption to the flow Works locally and in the cloud Faster data collection Collected data is persisted ©2010 Improving Enterprises, Inc.
  • 6. How-to Using the results ©2010 Improving Enterprises, Inc.
  • 7. Yes, I want to setup logging! Pick a framework Proper configuration Consider ways to parse logs Logging will change with the application ©2010 Improving Enterprises, Inc.
  • 8. Frameworks Log4net Nlog Apache BSD Logs arrays Integrates with MSMQ Configuration, log levels and categories, rotate log files, thread-safe logging. Support: online documentation, tutorials, online forums. ©2010 Improving Enterprises, Inc.
  • 9. Planning and Strategy Enough and but not too much Preserve correctness readability of the code performance ©2010 Improving Enterprises, Inc.
  • 10. Planning and Strategy (contd.) Database Files Easy to parse, Very hard to parse, hard to evolve easy to change Uses DB Requires FS connections access Can cause app Can fill up space crash ©2010 Improving Enterprises, Inc.
  • 11. Best Practices Relate each message to generating point Code Data Format messages for readability Define .ToString on objects ©2010 Improving Enterprises, Inc.
  • 12. More Best Practices Input and output Errors and exceptions Transitions Integration points Thread rendezvous ©2010 Improving Enterprises, Inc.
  • 13. Practices to avoid Little information … // step 1 Logger.info(“did something”); … // ste 2 Logger.info(“did more work”); foreach (…) { … // useful work Logger.info(“working hard”); } ©2010 Improving Enterprises, Inc.
  • 14. Practices to avoid (contd.) Long and boring ©2010 Improving Enterprises, Inc.
  • 15. Practices to avoid (contd.) Side effects Logger.info(count++ “: did something”); Errors and exceptions Logger.info(m.GetValue()); ©2010 Improving Enterprises, Inc.
  • 16. Using the results ©2010 Improving Enterprises, Inc.
  • 17. You’ve got logs! Rotate logs: by size, by time Retention policy 2-level storage Provide access - read only! Transfer and analysis Warning: large datasets ©2010 Improving Enterprises, Inc.
  • 18. Security and performance Moving and processing can impact performance Absolutely no sensitive data ©2010 Improving Enterprises, Inc.
  • 19. Learning from the logs Never rely on eye-balling WYS is not WYG Aggregate data Distinguish common and rare ©2010 Improving Enterprises, Inc.
  • 20. Tools Process datasets: line by line grep, Perl, awk, cut, tail, head with less memory vi, notepad++ ©2010 Improving Enterprises, Inc.
  • 21. Logging For Fun and Profit Jane Prusakova Jane.Prusakova@ImprovingEnter prises.com http://softwareandotherthings.blog spot.com Improving Enterprises Houston TechFest 09/08/2012 ©2010 Improving Enterprises, Inc.
  • 22. Upcoming Public Classes Object Oriented Design and Test Driven Development Oct. 1st – Oct. 4th Agile Development with TFS Oct. 8th – Oct. 11th Professional Scrum Master Oct. 16th – Oct. 17th Agile QA with TFS Oct. 24th – 26th Interested? Email training@improvingenterprises.com ©2010 Improving Enterprises, Inc.
  • 23. Lunch and Learns / Assessments Lunch and Learns Have an Improver come to speak with your team on conceptual topics more targeted to your environment. Assessments Have an Improver assess your environment and lend some experience on technical topics. Interested? Contact – devlin.liles@improvingenterprises.com ©2010 Improving Enterprises, Inc.
  • 24. Make it Happen in the Cloud: Windows Azure Developer Camp We will start with the basics and build on to more advanced topics, featuring hands-on labs for: Windows Azure Cloud Services Windows Azure SQL Database Windows Azure Virtual Machines Windows Azure Access Control Services Service Remoteing with Windows Azure Service Bus Presented by: Improving Enterprises When: October 22, 2012 9am-5pm Where: Microsoft Office Houston Registration: http://bit.ly/ImprovingAzure ©2010 Improving Enterprises, Inc.

Hinweis der Redaktion

  1. Shilpa: Without proper planning and clear strategy, the log messages produced by the system may not be useful for problem resolution.Effective logging is a balance between logging enough data to debug problems, while not dumping so much it confuses the issue.
  2. Shilpa: Without proper planning and clear strategy, the log messages produced by the system may not be useful for problem resolution.Effective logging is a balance between logging enough data to debug problems, while not dumping so much it confuses the issue.
  3. Both Log4net and Nlog are open source, free libraries. Well-used and well-loved, mature technologies, that are known to work very well. No option to buy corporate support, but there is plenty of free support from the user community available online.
  4. While I prefer to log to a file: More flexibility to change what is being loggedLogging doesn’t compete with the application for DB connectionsDB access is broken more often than file accessWhy you may choose to log to the DB: Easier to parse logsIt is possible to use Aspects to separate logging concerns from the application logic - for logs that are stable. If you use logging to trace problems as the application is being developed and maintained – putting logs with the code is simpler and helps to shorted the development cycle.
  5. While I prefer to log to a file: More flexibility to change what is being loggedLogging doesn’t compete with the application for DB connectionsDB access is broken more often than file accessWhy you may choose to log to the DB: Easier to parse logsIt is possible to use Aspects to separate logging concerns from the application logic - for logs that are stable. If you use logging to trace problems as the application is being developed and maintained – putting logs with the code is simpler and helps to shorted the development cycle.
  6. Go back to examples
  7. Go back to examples
  8. Unless step 1 or step 2 throw, we already know both will happen – no need to log the second.When putting loggin inside a loop, it’s helpful to record loop counter and the item being processed.
  9. It is important that logs are dense with information. If logging an object with no ToString method, it’s full type name will be printed – bad.Frameworks provide a way to post file and line from where logging is done – no need to do it in text.
  10. Shilpa: Without proper planning and clear strategy, the log messages produced by the system may not be useful for problem resolution.Effective logging is a balance between logging enough data to debug problems, while not dumping so much it confuses the issue.
  11. How to handle large log files,e.g Roll the files.... (zip them up after certain days etc....)
  12. A rare bug is harder to trace – and usually presents less of a problem to the business. When arbitraging future work, use logs to learn what users want.