Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8921187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:28:32+00:00 2026-06-15T06:28:32+00:00

I have set up Monolog for our Symfony2 project to email out critical errors

  • 0

I have set up Monolog for our Symfony2 project to email out critical errors to us when they occur.

However I would also like to log non-critical errors also, and to email these errors out to different recipients. I am struggling to see this in the documentation however it looks like it should be possible. I have set up the config as follows:

parameters:
    error_mail_sender: error@mysite.com
    error_mail_recipients: [siteerrors@mysite.com]
    critical_error_mail_recipients: [siteerrors@mysite.com, developer@developers.com]

monolog:
    handlers:
        main_critical:
            type:         fingers_crossed
            action_level: critical
            handler:      grouped_critical
            bubble:       false
        main_error:
            type:         fingers_crossed
            action_level: error
            handler:      grouped_error
        grouped_critical:
            type:    group
            members: [streamed, buffered_critical]
        grouped_error:
            type:    group
            members: [streamed, buffered_error]
        streamed:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
        buffered_critical:
            type:    buffer
            handler: swift_critical
        buffered_error:
            type:    buffer
            handler: swift_error
        swift_critical:
            type:       swift_mailer
            from_email: %error_mail_sender%
            to_email:   %error_mail_recipients%
            subject:    Critical error occurred!
            level:      debug
        swift_error:
            type:       swift_mailer
            from_email: %error_mail_sender%
            to_email:   %critical_error_mail_recipients%
            subject:    Non-critical error occurred
            level:      debug

With this set up we receive the critical errors but don’t get the non-critical errors.

This set up was loosely based on the (unaccepted) answer to this question: How to include the severity of a log in the e-mail subject?. (I would have up-voted the answer had it worked for me!!)

Can anyone spot what is wrong with this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:28:34+00:00Added an answer on June 15, 2026 at 6:28 am

    The problem seems to be bubble: false in the first handler, that means it’ll stop propagating messages to other handlers.

    Another note, I would remove the group and the streamed handler from grouped_critical, because it will already receive errors from grouped_error, resulting in duplicate entries in the log file.

    So this should work:

    parameters:
        error_mail_sender: error@mysite.com
        error_mail_recipients: [siteerrors@mysite.com]
        critical_error_mail_recipients: [developer@developers.com]
    
    monolog:
        handlers:
            main_critical:
                type:         fingers_crossed
                action_level: critical
                handler:      buffered_critical
            buffered_critical:
                type:    buffer
                handler: swift_critical
            swift_critical:
                type:       swift_mailer
                from_email: %error_mail_sender%
                to_email:   %error_mail_recipients%
                subject:    Critical error occurred!
                level:      debug
    
            main_error:
                type:         fingers_crossed
                action_level: error
                handler:      grouped_error
            grouped_error:
                type:    group
                members: [streamed, buffered_error]
            streamed:
                type:  stream
                path:  "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
            buffered_error:
                type:    buffer
                handler: swift_error
            swift_error:
                type:       swift_mailer
                from_email: %error_mail_sender%
                to_email:   %critical_error_mail_recipients%
                subject:    Non-critical error occurred
                level:      debug
    

    I reordered them to make it easier to see the two handler chains as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up some custom symfony project-level settings in the file config/project.yml following
I have set a button onTouchListener and I would like to replace it with
I have set up cruisecontrol.net cs for my project that has a number of
I have set up a dynamic web project in Eclipse with a Tomcat 5.5
I have set up a java project in Eclipse and I want to put
I have set up spring security which works fine, however in one of my
I have set my FileMerge not to ignore any file. However, it ignores my
I have set the below parameters in sqlplus to display my view out put
Have set up a small website for a client however contact form submissions are
I have set new email template from the backend for order emails and applied

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.