Skip to content

Commit

Permalink
feature #577 Update logs configuration (ogizanagi)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Update logs configuration

to match the standard edition configuration, which is way more convenient.
In dev, it'll now log every debug information but events, console errors are now logged natively and we don't need them to be output on stderr (we already have the stacktrace when running the console), and the `server:log` command allows to see logs in real-time.

Commits
-------

96e7fc1 Update logs configuration
  • Loading branch information
javiereguiluz committed Jun 11, 2017
2 parents 01a021a + 96e7fc1 commit 60eedfb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/config/config.yml
Expand Up @@ -48,6 +48,8 @@ framework:
fragments: ~
http_method_override: true
assets: ~
php_errors:
log: true

# Twig Configuration (used for rendering application templates)
twig:
Expand Down
18 changes: 13 additions & 5 deletions app/config/config_dev.yml
Expand Up @@ -14,12 +14,20 @@ web_profiler:
monolog:
handlers:
main:
type: stream
path: "%env(SYMFONY_LOG)%"
level: info
type: stream
path: '%env(LOG_URL)%'
level: debug
channels: ['!event']
console:
type: console
bubble: false
type: console
process_psr_3_messages: false
channels: ['!event', '!doctrine', '!console']
# To follow logs in real time, execute the following command:
# `bin/console server:log -vv`
server_log:
type: server_log
process_psr_3_messages: false
host: 127.0.0.1:9911
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
Expand Down
2 changes: 1 addition & 1 deletion app/config/config_prod.yml
Expand Up @@ -19,7 +19,7 @@ monolog:
handler: nested
nested:
type: stream
path: "%env(SYMFONY_LOG)%"
path: '%env(LOG_URL)%'
level: debug
console:
type: console
2 changes: 1 addition & 1 deletion app/config/parameters.yml.dist
Expand Up @@ -12,7 +12,7 @@ parameters:
env(SYMFONY_SECRET): 'secret_value_for_symfony_demo_application'

# Destination for log files; can also be "php://stderr" etc
env(SYMFONY_LOG): '%kernel.logs_dir%/%kernel.environment%.log'
env(LOG_URL): '%kernel.logs_dir%/%kernel.environment%.log'

# this demo application uses an embedded SQLite database to simplify setup.
# in a real Symfony application you probably will use a MySQL or PostgreSQL database
Expand Down

0 comments on commit 60eedfb

Please sign in to comment.