Debugging your PHP Cake Application
aboutn   Developer and Operations at     seatgeek.comn   Cake Core - Plugins Site and IRC Trolln   Open Source Contribu...
Trace the
DERP
packages/dl/1/
DERPpackages/dl/1/
Showing Context
debug($herp)/app/Controller/PackagesController.php (line 107)                     derp
debug($herp)/app/Controller/PackagesController.php (line 107)                     derp                            class name
debug($herp)/app/Controller/PackagesController.php (line 107)                     derp                           line number
debug($herp)/app/Controller/PackagesController.php (line 107)                     derp                        the good bits
xdebugapt-get install php5-xdebug          # php.ini          [xdebug]    xdebug.cli_color = 1
var_dump()
overrides   var_dump()var_dump
var_dump()type
var_dump()contents
var_dump()length
xdebug_debug_zval
xdebug_debug_zvaltight loop goodies
Don’t BreakProduction
debug(); die;
debug(); die;
diebug()
diebug()
Show Application     State
debug_kitgit clone git://github.com/cakephp/debug_kit
debug_kit
debug_kit
debug_kit
debug_kit
etc.
the server is part of  the application
SO TREAT IT AS    SUCH
redis-live
paramedic
varnishstat
statistics are    good
visualization    are
Notify on Errors
first pass
second pass
third pass
fourth pass
fifth pass?
Verbose Logging
printf
printfno timestamp
printfneeds newlines
printfSUCKS
sgLogMessage
sgLogMessagecategorization
sgLogMessageauto-out with  newlines
sgLogMessagestandard date
sgLogMessagestored logs!
logs can never be  too VERBOSE
Unify Logging
logstash log-aggregator message parsernotification system
logstash
logstash
¿logstash?n   Searchable logsn   Aggregate all logs in one placen   Alert, Notify, Create metrics from one     placen ...
Aggregate Metrics
graphite time-series data graph renderingsimple graph url-
graphite does not...alert on data collect dataexport data      https://gist.github.com/
sending statsStatsd::increment(‘seatgeek.www.php.e_warning’);# sends data to statsd# metrics aggregated# view in your grap...
interestingn   check mysql replication lengthn   track conversions in your appn   expense trackingn   alerting systems
earthquake effects
apc configuration
Questions?
Debugging Your PHP Cake Application
Debugging Your PHP Cake Application
Debugging Your PHP Cake Application
Debugging Your PHP Cake Application
Upcoming SlideShare
Loading in …5
×

Debugging Your PHP Cake Application

2,055 views

Published on

Wherein I go over some common methods for getting data out of your application and into the hands of developers.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,055
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
10
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Debugging Your PHP Cake Application

    1. 1. Debugging your PHP Cake Application
    2. 2. aboutn Developer and Operations at seatgeek.comn Cake Core - Plugins Site and IRC Trolln Open Source Contributor (github.com/ josegonzalez)
    3. 3. Trace the
    4. 4. DERP
    5. 5. packages/dl/1/
    6. 6. DERPpackages/dl/1/
    7. 7. Showing Context
    8. 8. debug($herp)/app/Controller/PackagesController.php (line 107) derp
    9. 9. debug($herp)/app/Controller/PackagesController.php (line 107) derp class name
    10. 10. debug($herp)/app/Controller/PackagesController.php (line 107) derp line number
    11. 11. debug($herp)/app/Controller/PackagesController.php (line 107) derp the good bits
    12. 12. xdebugapt-get install php5-xdebug # php.ini [xdebug] xdebug.cli_color = 1
    13. 13. var_dump()
    14. 14. overrides var_dump()var_dump
    15. 15. var_dump()type
    16. 16. var_dump()contents
    17. 17. var_dump()length
    18. 18. xdebug_debug_zval
    19. 19. xdebug_debug_zvaltight loop goodies
    20. 20. Don’t BreakProduction
    21. 21. debug(); die;
    22. 22. debug(); die;
    23. 23. diebug()
    24. 24. diebug()
    25. 25. Show Application State
    26. 26. debug_kitgit clone git://github.com/cakephp/debug_kit
    27. 27. debug_kit
    28. 28. debug_kit
    29. 29. debug_kit
    30. 30. debug_kit
    31. 31. etc.
    32. 32. the server is part of the application
    33. 33. SO TREAT IT AS SUCH
    34. 34. redis-live
    35. 35. paramedic
    36. 36. varnishstat
    37. 37. statistics are good
    38. 38. visualization are
    39. 39. Notify on Errors
    40. 40. first pass
    41. 41. second pass
    42. 42. third pass
    43. 43. fourth pass
    44. 44. fifth pass?
    45. 45. Verbose Logging
    46. 46. printf
    47. 47. printfno timestamp
    48. 48. printfneeds newlines
    49. 49. printfSUCKS
    50. 50. sgLogMessage
    51. 51. sgLogMessagecategorization
    52. 52. sgLogMessageauto-out with newlines
    53. 53. sgLogMessagestandard date
    54. 54. sgLogMessagestored logs!
    55. 55. logs can never be too VERBOSE
    56. 56. Unify Logging
    57. 57. logstash log-aggregator message parsernotification system
    58. 58. logstash
    59. 59. logstash
    60. 60. ¿logstash?n Searchable logsn Aggregate all logs in one placen Alert, Notify, Create metrics from one placen Empower your developers
    61. 61. Aggregate Metrics
    62. 62. graphite time-series data graph renderingsimple graph url-
    63. 63. graphite does not...alert on data collect dataexport data https://gist.github.com/
    64. 64. sending statsStatsd::increment(‘seatgeek.www.php.e_warning’);# sends data to statsd# metrics aggregated# view in your graphite backend
    65. 65. interestingn check mysql replication lengthn track conversions in your appn expense trackingn alerting systems
    66. 66. earthquake effects
    67. 67. apc configuration
    68. 68. Questions?

    ×