duange2971 2014-08-04 16:02
浏览 127
已采纳

如何将错误的日期/时间输入HHVM错误日志

I'm running HHVM 3.1.0 and nginx. I'm set to send errors in HHVM to it's own log file, not return them through nginx. One thing I noticed is the errors lack any type of timestamp or date /time listed, just the string of the error, here's some examples:


Warning: Invalid argument: function: not a valid callback array in /srv/http/nx/app/model/Session.php on line 57

Fatal error: Failed to initialize storage module: user (path: ) in /srv/http/nx/app/model/Session.php on line 57 

Warning: Invalid argument: function: not a valid callback array

Is there a way to better format these error log entries to be more usable? At a minimum to have the date and time show up? Is there a way to pass errors back through nginx to log them in the way that php-fpm would? Here's an example of using php-fpm and getting errors in my /var/log/nginx/error.log (notice the nice format):

  [04-Aug-2014 13:53:55 UTC] PHP Warning:  Invalid argument supplied for foreach() in /srv/http/nx/app/controller/website/SEOFinds.php on line 164

For reference, here's my HHVM config file in /etc/hhvm/php.ini

; php options

pid = /var/run/hhvm/pid
date.timezone="America/New_York"
; hhvm specific

hhvm.server.file_socket=/var/run/hhvm/hhvm.sock
;hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.mysql.typed_results = false

hhvm.eval.jit_warmup_requests = 0

Below is my nginx location block:

    location ~ \.php$ {
                 fastcgi_buffer_size 128k;
                 fastcgi_buffers 128 16k;
                 fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
                 fastcgi_index   index.php;
                 fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                 include         fastcgi_params;
         }
  • 写回答

1条回答 默认 最新

  • doujian0265 2014-08-04 20:30
    关注

    The time stamp is controlled by the hhvm.log.header INI setting. If you set it to true you'll get time stamps in your logs.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退