问题
I constantly am seeing a bunch of the following log:
[2015-02-15 09:08:16] request.INFO: Matched route "AppMainBundle_daftar_toko_province" (parameters: "_controller": "App\MainBundle\Controller\ZHomepageController::daftarTokoAction", "provinceName": "DKI JAKARTA", "_route": "AppMainBundle_daftar_toko_province") [] []
[2015-02-15 09:08:16] security.INFO: Populated SecurityContext with an anonymous Token [] []
[2015-02-15 09:08:16] security.DEBUG: Write SecurityContext in the session [] []
in my prod.log, how can I disable this and I just want to see the errors. Here is my monolog settings:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: file
excluded_404s:
- ^/items/
file:
type: stream
level: debug
doctrine:
action_level: debug
type: stream
path: %kernel.logs_dir%/doctrine_%kernel.environment%.log
channels: doctrine
回答1:
You can define which channels to be logged. Use something like this to ignore a specific channel:
channels: ["!security"]
If you only want to ignore specific log levels you can use the level param or use a combination of both in a new handler.
来源:https://stackoverflow.com/questions/28523211/how-to-disable-security-info-and-security-debug-in-monolog-symfony2-logging