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

  • Home
  • SEARCH
  • 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 1060775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:22:42+00:00 2026-05-16T18:22:42+00:00

I set my loggers up in my Bootstrap.php like so: $logger = new Zend_Log();

  • 0

I set my loggers up in my Bootstrap.php like so:

 $logger = new Zend_Log();
    if($environment->debug == '1')
    {
        $stream = @fopen('/var/www/html/rta/rta.log','a',false);
        if(!$stream){ throw new Exception('Failed to open log stream'); }
        $writer = new Zend_Log_Writer_Stream($stream);
        $logger->addWriter($writer);
        $logger->addWriter(new Zend_Log_Writer_Firebug());
    }
    else
    {
        // Do something else
    }
    Zend_Registry::set('logger',$logger);

I have the following code that I set up to fail:

$data = array(
            'config_id'      => $config->getConfigId(),
            'pass_column'    => $config->getPassColumn(),
            'filename'       => $config->getFilename(),
            'date_format'    => $config->getDateFormat(),
            'mapping_config' => $config->getMappingConfig(),
            'config_name'    => $config->getConfigName(),
            'client_id'      => $config->getClientId(),
            'description'    => $config->getDescription(),
        );

        $where = $this->getDbTable()->getAdapter()->quoteInto('config_id = ?',$config->getConfigId());
        $where = null;
        try
        {
            $this->getDbTable()->update($data,$where);
        }catch(Exception $e)
        {
            Zend_Registry::get('logger')->err('Could not update configuration.');
            Zend_Registry::get('logger')->err($e);
            return false;
        }
        return true;

I set two log writers: Stream and FirePHP.
The stream log writer successfully caught and wrote the exception but FirePHP didn’t do anything. If I put other log messages other places in my code, like indexAction it shows those just fine in both. Am I missing something?

EDIT
The failure code is in my database mapper, not a controller. Could it be that it doesn’t have access to the HTTP headers?

  • 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-16T18:22:42+00:00Added an answer on May 16, 2026 at 6:22 pm

    The following example below shows how to make FirePHP get the header info it needs without using the FrontController.

        // create the logger and log writer
        $writer = new Zend_Log_Writer_Firebug();
        $logger = new Zend_Log($writer);
    
        // get the wildfire channel
        $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
    
        // create and set the HTTP response
        $response = new Zend_Controller_Response_Http();
        $channel->setResponse($response);
    
        // create and set the HTTP request
        $channel->setRequest(new Zend_Controller_Request_Http());
    
        // record log messages
        $logger->info('info message');
        $logger->warn('warning message');
        $logger->err('error message');
    
        // insert the wildfire headers into the HTTP response
        $channel->flush();
    
        // send the HTTP response headers
        $response->sendHeaders();
    ?>
    

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

Sidebar

Related Questions

I set a passphrase when creating a new SSH key on my laptop. But,
Foo* set = new Foo[100]; // ... delete [] set; You don't pass the
Is it possible to set default log level for entire applicaton? I would like
I have a few data loggers in the field. The manufacturer set them up
import java.util.*; import org.directwebremoting.util.Logger; public class People { public People() { people = new
I am using PHP Swift Mailer to send a bulk mail to a set
When my logger is set to all, i am seeing messages that my code
I'm using log4perl with a set of scripts and objects. I'd like to be
I'm new to log4net and I'm not quite sure how to set up my
could anybody explain to me, how to set up java Logger for various classes

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.