Skip to content

Commit

Permalink
Merge pull request #73 from SURFnet/feature/syslogging
Browse files Browse the repository at this point in the history
Use local syslog for logging
  • Loading branch information
DRvanR committed Jun 3, 2015
2 parents 63da305 + 69e3967 commit 96cfd59
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 55 deletions.
50 changes: 35 additions & 15 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,43 @@ web_profiler:
toolbar: "%debug_toolbar%"
intercept_redirects: "%debug_redirects%"

# Be careful not to remove the prod-signaler handler, which overwrites
# the prod-signaler handler defined in logging.yml. The handler defined
# in logging.yml disables bubbling which means that none of the handlers
# below are invoked. Since the current dev setup is incompatible with the
# prod setup defined in logging.yml, this means we won't see any logs in
# the infrastructure currently used (graylog). Overwriting the handler
# here resolves that and reinstates the dev logging setup.
#
# this configuration must be replaced to reflect production setup
# see https://www.pivotaltracker.com/story/show/96056010
#
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.debug.log"
level: debug
console:
type: console
bubble: false
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
prod-signaler:
type: group
members:
- main_graylog
- main_logfile
- main_debuglog
main_graylog:
type: buffer
handler: graylog
level: NOTICE
main_logfile:
type: stream
handler: logfile
level: NOTICE
path: %kernel.logs_dir%/%kernel.environment%.log
main_debuglog:
type: stream
handler: logfile
level: DEBUG
path: "%kernel.logs_dir%/%kernel.environment%.debug.log"
graylog:
type: gelf
publisher: { hostname: %graylog_hostname% }
formatter: surfnet_stepup.monolog.full_message_exception_gelf_message_formatter

assetic:
use_controller: "%use_assetic_controller%"
Expand Down
22 changes: 0 additions & 22 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,3 @@ imports:
# validation:
# cache: apc

monolog:
handlers:
prod-signaler:
type: fingers_crossed
action_level: ERROR
handler: prod_main
bubble: false # if we handle it, nothing else should
prod_main:
type: group
members:
- main_graylog
- main_logfile
- buffered_mailer
buffered_mailer:
type: buffer
handler: swift
swift:
type: swift_mailer
# these email addresses should be configurable and configured correctly
from_email: [email protected]
to_email: [email protected]
subject: "[StepUp][SelfService][%kernel.environment%] An Error Occurred!"
29 changes: 11 additions & 18 deletions app/config/logging.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
monolog:
handlers:
main:
type: group
members:
- main_graylog
- main_logfile
main_graylog:
type: buffer
handler: graylog
level: NOTICE
main_logfile:
type: stream
handler: logfile
level: NOTICE
path: %kernel.logs_dir%/%kernel.environment%.log
graylog:
type: gelf
publisher: { hostname: %graylog_hostname% }
formatter: surfnet_stepup.monolog.full_message_exception_gelf_message_formatter
prod-signaler:
type: fingers_crossed
action_level: ERROR
passthru_level: NOTICE # this means that all message of level NOTICE or higher are always logged
handler: main_syslog
bubble: false # if we handle it, nothing else should
main_syslog:
type: syslog
ident: stepup-selfservice
facility: user

0 comments on commit 96cfd59

Please sign in to comment.