Symfony 1.4 dev not working

I'm having trouble working with development environment logs in Symfony 1.4.8. Meanwhile, logs in the prod environment work fine with the same settings. I am not sure what is wrong with my dev environment.

The idea is to register messages in the Action and Template files with the following code:

    sfContext::getInstance()->getLogger()->err('Error Message Here!!!');

However, the error message did not appear in frontend_dev.log in the dev environment. To enable logging, I changed settings.yml and factories.yml; I cleared symfony cache and logs. For some odd reason, Symfony did not create a new frontend_dev.log in the dev environment after I cleared the logs (deleting the old one). On the other hand, in the prod environment, symfony generated an empty frontend_prod.log after running the clear logs command. I'm not sure what caused this, and if it has anything to do with logging that doesn't work in a dev environment.

Here are the settings in my settings.yml and factories.yml

settings.yml:

prod:
  .settings:
    no_script_name:         true
    logging_enabled:        true
    cache:                  false
    etag:                   false

dev:
  .settings:
    error_reporting:        <?php echo (E_ALL | E_STRICT)."\n" ?>
    logging_enabled:        true
    web_debug:              true
    cache:                  false
    no_script_name:         false
    etag:                   false

factories.yml:

prod:
#  logger:
#    class:   sfNoLogger
#    param:
#      level:   err
#      loggers: ~
  logger:
    class: sfAggregateLogger
    param:
      level: err
      loggers:
        sf_web_debug:
          class: sfWebDebugLogger
          param:
            level: debug
            condition:       %SF_WEB_DEBUG%
            xdebug_logging:  true
            web_debug_class: sfWebDebug
        sf_file_debug:
          class: sfFileLogger
          param:
            level: debug
            file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log

dev:
  mailer:
    param:
      delivery_strategy: none

  logger:
    class: sfAggregateLogger
    param:
      level: debug
      loggers:
        sf_web_debug:
          class: sfWebDebugLogger
          param:
            level: debug
            condition:       %SF_WEB_DEBUG%
            xdebug_logging:  true
            web_debug_class: sfWebDebug
        sf_file_debug:
          class: sfFileLogger
          param:
            level: debug
            file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log

Please let me know what I am doing wrong. Thank.

Update:

I also tried calling the following in actions.class.php

$this->logMessage('ErrorMessageHere', 'err');

The same result, I received an error message in the prod environment, but not in the dev environment.

reset,

    php symfony project:permission
    >> chmod 777 /var/www/ac2/web/uploads
    >> chmod 777 /var/www/ac2/cache
    >> chmod 777 /var/www/ac2/log
    >> chmod 777 /var/www/ac2/symfony
    >> chmod 777 /var/www/ac2/cache/frontend
    ......
    drwxrwxrwx 2 www-data www-data 4096 2011-11-16 11:51 log

, , . , dev Symfony frontend_dev.log, prod frontend_prod.log.

frontend_dev.php:

<?php

// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it or make something more sophisticated.
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', '192.168.1.55')))
{
  die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
sfContext::createInstance($configuration)->dispatch();

2:

- dev prod.

symfony , 2- , . , , , , prod - . 4-5 , frontend_dev.log, frontend_prod.log. ; , frontend_dev.log, frontend_prod.log

: prod /web/index.php 4 actions.class.php 4

$this->logMessage('errortest1', 'err');
$this->logMessage('errortest2', 'err');
$this->logMessage('errortest3', 'err');
$this->logMessage('errortest4', 'err');

dev prod prod. errortest1 errortest2 frontend_dev.log errortest3, errortest4 frontend_prod.log prod prod. frontend_dev.log errortest3, errortest4 frontend_prod.log dev. errortest1 errortest2 frontend_dev.log, frontend_prod.log .

, , , symfony ?

+5
1

"\n" intefering ?

.

dev:
  .settings:
    error_reporting:        <?php echo (E_ALL | E_STRICT); ?>

    logging_enabled:        true
    web_debug:              true
0

All Articles