2011-08-01 126 views

回答

1

Apache日誌不同於symfony提供的日誌記錄。除了symfony的其他原因,Apache日誌也很有用。我通常爲我的本地開發使用以下虛擬主機配置。

<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> 

爲symfony1.2,我配置一樣factories.yml中以下

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

我也覺得很有用'sfFileLogger'隨着產量的'err'水平。 – prodigitalson