Skip to content

Instantly share code, notes, and snippets.

@csarrazi
Last active May 10, 2016 18:35
Show Gist options
  • 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