Logging in Production

Logging in Production

Debugging issues with your app once it hits the App Store can be … fun … sometimes. That dreaded “it doesn’t work” email from a customer, in which they provide no useful information and there’s no crash log to help you. Curtis is going to walk through a logging framework, CocoaLumberjack, and a few techniques he’s come up with, to make his life debugging customer issues much less painful.

Demo code: https://github.com/parrots/CocoaLumberjackDemo

9b54e5324785eb939bcc8f15c724baf9?s=128

Curtis Herbert

October 11, 2018
Tweet

Transcript

  1. Logging in Production @parrots

  2. zipzap, Mapbox-iOS-SDK, MapboxMobileEvents, GoogleMaps, VTAcknowledgementsViewController, KissXML, MHWDirectoryWatcher, FBSDKCoreKit, JLRoutes, Crashlytics,

    FXKeychain, ReachabilitySwift, 1PasswordExtension, Firebase/Core, Firebase/Analytics, Firebase/ RemoteConfig, GzipSwift, JWT, SHEmailValidator, SDWebImage, Mobile-Buy-SDK, AFNetworking, ClusterKit, ActionSheetPicker, SwiftLint, GPSKit, CSV.swift, CHCSVParser, SwiftyJSON, CocoaLumberjack/Swift, MMWormhole
  3. CocoaLumberjack pod 'CocoaLumberjack/Swift'

  4. None
  5. Why Log?

  6. RECaf https://recaf.app

  7. None
  8. Take a look at these logs for me, when you

    get a chance. Joe Cieplinski 09:50 2018/09/19 10:13:56:392 Received invalid product identifier: com.joecieplinski.RECaf.12months
  9. What Does It Look Like? Traditionally

  10. NSLog(“Something went wrong!”)

  11. NSLog(“There were \(entryCount) entries.”)

  12. None
  13. What Does It Look Like? Suggested Way

  14. iOS Version: 12.0 App Version: 1.1.0 Is Subscribed: true Free

    Trial Expired: true Expiration Date: 2018-10-03 17:06:13 +0000 HealthKit Permission Granted: true DebugInfo.txt
  15. 2018/10/11 10:31:00:014 Non-OK response from server: 401 2018/10/11 10:31:00:014 Error

    fetching metadata 401: ("{\n \"message\" : \"Authorization error\",\n \"success\" : false\n}") 2018/10/11 10:32:19:259 Non-OK response from server: 401 2018/10/11 10:32:19:259 Error fetching metadata 401: (“{\n \"message\" : \"Authorization error\",\n \"success\" : false\n}") DebugLogs.txt
  16. OK, Sounds Cool. How Do?

  17. CocoaLumberjack pod 'CocoaLumberjack/Swift'

  18. Levels Loggers

  19. Levels Loggers • Error • Warning • Info • Debug

    • Verbose
  20. Levels Loggers • Error • Warning • Info • Debug

    • Verbose • Console • System • Rolling Files
  21. Demo Agenda • Configuring log output destinations (loggers) • Configuring

    log level for debug vs release • Attaching logs to Crashlytics • Retrieving logs for customer support • Adding additional info for customer support
  22. @parrots Thanks! github/parrots/CocoaLumberjackDemo