Upgrade to Pro — share decks privately, control downloads, hide ads and more …

When Monolog meet ELK

When Monolog meet ELK

talk given during sfPot Paris

Olivier Dolbeau

July 15, 2014
Tweet

More Decks by Olivier Dolbeau

Other Decks in Programming

Transcript

  1. When
    Monolog
    meet
    ELK

    View full-size slide

  2. Me
    Olivier Dolbeau
    @odolbeau
    Web Architect

    View full-size slide

  3. Handlers
    ● StreamHandler
    ● ErrorLogHandler
    ● SwiftMailerHandler
    ● SyslogUdpHandler
    ● FirePHPHandler
    ● FingersCrossedHandler
    ● NullHandler
    ● …
    more than 36 handlers!

    View full-size slide

  4. Channels
    Just a name for your logger.
    http://symfony.com/doc/current/cookbook/logging/channels_handlers.html

    View full-size slide

  5. PSR-3 dude !

    View full-size slide

  6. PSR-3 dude !
    Context
    Context
    Context

    View full-size slide

  7. What can I do with that?
    ● Different handlers for different usage
    ○ FirePHP for web
    ○ Console for cli
    ● Processor per handler
    ● Processor per channel
    http://symfony.com/doc/current/cookbook/logging/channels_handlers.html

    View full-size slide

  8. Few things you can do
    ● All my cli logs are displayed in console
    ● I use FirePHP for web
    ● publication logs are very important. I want to
    receive an email if an exception occurred.
    ● I have a processor dedicated to workers. I
    can directly see which message raise an
    error.
    ● I have a processor dedicated to web (you
    saw it)
    ● ...

    View full-size slide

  9. I found some IPs !

    View full-size slide

  10. I found the criticity !

    View full-size slide

  11. Maybe it’s the one I want ?

    View full-size slide

  12. ● real time data
    ● distributed
    ● multi-tenancy
    ● document oriented
    ● schema free
    ● per operation
    persistence
    ● real time analytics
    ● high availability
    ● full text search
    ● conflict management
    ● restful api
    ● built on top of apache
    lucene

    View full-size slide

  13. It’s all about logs!
    ● Inputs (41)
    ● Filters (50)
    ● Outputs (55)
    Logstash

    View full-size slide

  14. Input example

    View full-size slide

  15. Filter example

    View full-size slide

  16. Output example

    View full-size slide

  17. Not bad right? :D

    View full-size slide

  18. How to :
    send logs with Monolog
    to ELK ?

    View full-size slide

  19. Logstash input for gelf

    View full-size slide

  20. Conclusion
    ● Use Monolog (easy!)
    ● Use ELK
    ● Use monolog context
    ● Create dashboards
    ● Enjoy!

    View full-size slide