Skip to content

Instantly share code, notes, and snippets.

@csarrazi
Last active May 10, 2016 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csarrazi/bb6ac210827973033cbd to your computer and use it in GitHub Desktop.
Save csarrazi/bb6ac210827973033cbd to your computer and use it in GitHub Desktop.
Log guzzle requests in a different channel (and a different file)
# http://symfony.com/doc/current/cookbook/logging/channels_handlers.html#switching-a-channel-to-a-different-handler
monolog:
channels: ["guzzle"]
handlers:
main:
type: stream
path: /var/log/symfony.log
channels: ["!guzzle"]
guzzle:
type: stream
path: /var/log/guzzle.log
channels: [guzzle]
# http://symfony.com/doc/current/cookbook/logging/channels_handlers.html#configure-additional-channels-without-tagged-services
# https://github.com/csarrazi/CsaGuzzleBundle/blob/master/src/Resources/doc/available_subscribers.md#the-logger-subscriber
csa_guzzle:
logger:
enabled: true
service: monolog.logger.guzzle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment