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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:21:32+00:00 2026-05-13T22:21:32+00:00

we using symfony 1.0. We have an module work with Propel objects. The sql-querys

  • 0

we using symfony 1.0. We have an module work with Propel objects. The sql-querys are visible in the symfony-debugbar under the “DB” menu.

My problem is that we also use custom sql-querys via propel::getRS(“select …”)
This querys are not visible in the debug bar.

Does anyone have an idea how to do that?

  • 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-13T22:21:33+00:00Added an answer on May 13, 2026 at 10:21 pm

    Recommended way

    The standard logger in symfony would be the recommended method:

    from inside an action:

    $this->logMessage('executed SQL: '.$sql);
    

    from inside the model (or anywhere else):

    sfContext::getInstance()->getLogger()->info('executed SQL: '.$sql);
    

    These methods would insert your SQL queries into the ‘logs & msgs’ tab in the debug toolbar in the correct position in the execution chain.

    However, if you just want to see the queries at the top of the ‘logs & msgs’ tab and don’t need them to be stored in the permanent log, you can use $this->debugMessage($sql); instead, which would also mean you could see the queries together, and not search for them through the log execution chain.

    A potentially preferable way

    I suspect that you may want these SQL queries to appear on the ‘DB’ tab instead. This isn’t directly supported by symfony, but you could ‘hack’ this solution instead:

    from inside an action:

    $this->logMessage(sprintf("{sfCreole} executeQuery(): [x.xx ms] %s", $sql));
    

    from inside the model:

    sfContext::getInstance()->getLogger()->info(sprintf("{sfCreole} executeQuery(): [x.xx ms] %s", $sql));
    

    This mimics the behaviour of the debug option in symfony for logging SQL queries, and will therefore push your custom SQL query into the ‘DB’ tab in the debug toolbar. I leave the timing [x.xx ms] option up to you to implement if you wish it 🙂

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

Sidebar

Related Questions

I'm using Symfony and Doctrine, and have several many-to-many relations that work fine. But
I am using Symfony 1.3.2 and I have a page that uses a partial
I am writing an application using Symfony. I have some reusable components that I
I am using Symfony 1.2.9 (with Propel ORM), to build a website. I have
I am using Symfony 1.2.9, and I have a form that contains two date
I am using Symfony 1.4.8 and Propel as ORM. I have created a custom
Using Symfony 1.3 I have a normal form-filter that is used to filter values
I have a little disturbing problem in here! an using symfony 1.4 with Doctrine!
I'm using symfony 1.4 doctrine. I have a code that can validate phone numbers
I am using Symfony 1.3 and I have the following problem: I need a

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.