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 6854843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:41:03+00:00 2026-05-27T01:41:03+00:00

Normally you just get logger service, and logs go to: %kernel.root_dir%/%kernel.environment%.log I would like

  • 0

Normally you just get logger service, and logs go to:

%kernel.root_dir%/%kernel.environment%.log

I would like to log messages form SOAP services ONLY to:

%kernel.root_dir%/%kernel.environment%.soap.log

not to main logfile.

I’ve read the cookbook, but I don’t understand how to configure monolog.

Any help, clues?

  • 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-05-27T01:41:04+00:00Added an answer on May 27, 2026 at 1:41 am

    The MonologBundle logs everything using the same handlers for the whole framework. That means if one of your services needs to log to different handlers, you should create your own Logger/Handler and inject that in your service.

    This could be an example config (in yaml):

    services:
        my_logger:
            class: Symfony\Bridge\Monolog\Logger
            arguments: [soap]
            calls:
                - [pushHandler, [@my_handler]]
    
        my_handler:
            class: Monolog\Handler\StreamHandler
            # 200 = INFO, see Monolog::Logger for the values of log levels
            arguments: [%kernel.root_dir%/%kernel.environment%.soap.log, 200]
    
        soap_service:
            class: Your\Soap\Client
            arguments: [@my_logger]
    

    I hope this clarifies it.

    Update: as of symfony 2.1, you can also configure which channels receive which handlers, so you could alternatively do something like this:

    services:
         soap_service:
             class: Your\Soap\Client
             arguments: [@logger]
             tags:
                 - { name: monolog.logger, channel: soap }
    

    Which creates a new soap channel (i.e. logger instance receiving all handlers), then to configure different handlers for this channel:

    monolog:
        handlers:
            main:
                type: stream
                path: %kernel.root_dir%/%kernel.environment%.log
                level: error
                channels: [!soap]
            soap:
                type: stream
                path: %kernel.root_dir%/%kernel.environment%.soap.log
                level: info
                channels: [soap]
    

    This means the main handler will receive everything but the soap channel, and the soap handler will receive only the soap channel. You could also remove the channels key on the main handler if you want your main log file to have everything, but also have a copy of only the soap logs separately. This brings a lot of flexibility, and as you see the channels is an array so you can list channels you want, or use the blacklist !name notation to exclude some and include everything else.

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

Sidebar

Related Questions

On Windows, I normally just use the binary installer, but I would like to
Normally I would just do this. $str = preg_replace('#(\d+)#', ' $1 ', $str); If
If I have a table of a hundred users normally I would just set
I would normally just do this with a drop down list but the client
Normally when using VMWare Server 1.0.7 you are asked if you would like to
I'm working on a WCF service and I'd like to be able to get
I normally just @Autowire things into spring objects. But I've encountered a situation where
Normally it just puts multiline content on a one liner field and adds slightly
Normally I just redirect to a custom error page in on the Application_Error event,
A lot of time I have to code from home. Normally I just remote

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.