开发者

symfony 1.4 and Apache access/error logs

开发者 https://www.devze.com 2023-03-24 09:16 出处:网络
Symfony 1.4 is set up as the only virtual host in my Apache config. Should I make use of the Apache access logs and 开发者_StackOverflow中文版error logs or does symfony take care of both of these for

Symfony 1.4 is set up as the only virtual host in my Apache config. Should I make use of the Apache access logs and 开发者_StackOverflow中文版error logs or does symfony take care of both of these for me?


Apache logs are not the same as the logging provided by symfony. Apache logs are useful for other reasons than symfony's. I usually use the following virtual host config for my local development.

<VirtualHost *:80>

  ServerName dev.yoursite.com.br

  DocumentRoot "/home/you/dev/sfprojects/yoursite/web"
  DirectoryIndex index.php

  <Directory "/home/you/dev/sfprojects/yoursite/web">
    AllowOverride All
    Allow from All
  </Directory>

  Alias /sf /home/you/dev/sfprojects/yoursite/lib/vendor/symfony/data/web/sf
  <Directory "/home/you/dev/sfprojects/yoursite/lib/vendor/symfony/data/web/sf">
    AllowOverride All
    Allow from All
  </Directory>

  ErrorLog "/home/you/dev/sfprojects/yoursite/log/error.log"
  CustomLog "/home/you/dev/sfprojects/yoursite/log/web.log" combined

</VirtualHost>

For symfony, I configure the factories.yml like the following

dev:
  logger:
    class:   sfAggregateLogger
    param:
      level:   notice
      loggers:
        sf_file_err:
          class: sfFileLogger
          param:
            level: err
            file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%_error.log
        sf_file_notice:
          class: sfFileLogger
          param:
            level: notice
            file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%_notice.log
0

精彩评论

暂无评论...
验证码 换一张
取 消