English 中文(简体)
4. 辛夫林木
原标题:Symfony 1.4 dev logging not working

I m 遇到麻烦,无法在表象1.4.8中做工作。 同时,假环境中的标识与同一环境完全一致。 我不敢肯定我的发展中环境有什么错误。

想法是使用以下代码将信息登录在行动和模板档案中:

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

However, error message did not appear in frontend_dev.log in dev environment. To enable logging, I modified settings.yml and factories.yml; I cleared symfony cache and logs. For some odd reason, symfony did not generate a new frontend_dev.log in dev environment after I cleared logs (deleting the old one). On the other hand, in prod environment symfony generated a blank frontend_prod.log after performing clear logs command. I m not sure what had caused this and if this have anything to do with logging not working in dev environment.

这里是我所处的环境。 午餐和工厂。 注

<>strong>dings.yml:

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

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

www.un.org/Depts/DGACM/index_french.htm

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 m doing wrong. Thank you.

<>Update:

我也试图在行动中呼吁如下。

$this->logMessage( ErrorMessageHere ,  err );

结果是,我听到了在环境中而不是在发展中环境中的错误信息。

我还试图通过呼吁重新获得许可。

    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

不存在任何错误,它像记录夹一样有正确的许可。 发生了好事,在杰夫环境中,假名不会制造 log头_——dev.log,而是在清点后形成一种折射方式,创造了一个空白的前线——prod.log。

这是我的前线——发展中国家。

<?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();

<><>上>

我刚刚发现,我在发展中国家和有利环境的标志令人感兴趣。

在我的假冒项目中,有许多套读书单元,我一直在两个单元的“行动”和“模板”下测试电文。 然而,今天,我注意到了一个有趣的事件,当我在其他模块中测试时,杰夫环境产生了错误信息,并引人注。 如果在4-5单元中添加错误标识,则其中一些标识将出现在前端_dev.log,而另一些则将出现在前端_prod.log。 我尝试清除海滩和清理记录;但是,同样的模块会在前端_dev.log和其他模块中产生错误。

例如: 我在网站/指数中提供了有利环境。 php,并在4项不同行动中插入以下错误标识。 4个不同单元中的单元

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

If I enable both dev and prod error logging in prod environment. errortest1 and errortest2 will appear in frontend_dev.log and errortest3 and errortest4 will appear in frontend_prod.log If I only enable prod error logging in prod environment. frontend_dev.log will be empty and errortest3 and errortest4 will appear in frontend_prod.log If I only enable dev error logging in dev environment. errortest1 and errortest2 will appear in frontend_dev.log and frontend_prod.log will be empty

因此,我不敢肯定,我的匿名项目是否腐败?

问题回答

Might the " " at the end of the line be intefering with your code?

而是在界线之间留下差距。

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

    logging_enabled:        true
    web_debug:              true




相关问题
Best logging approach for composite app?

I am creating a Composite WPF (Prism) app with several different projects (Shell, modules, and so on). I am getting ready to implement logging, using Log4Net. It seems there are two ways to set up the ...

How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

Logging SAS scripts

I ve been developing a lot of Java, PHP and Python. All of which offer great logging packages (Log4J, Log or logging respectively). This is a great help when debugging applications. Especially if the ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

热门标签