2015-02-06 132 views
2

以下是应用delcaration JSON文件如何更改时区将PM2日志

{ 
    "apps" : [{ 
    "name"  : "test_v2", 
    "script"  : "bin/www", 
    "log_date_format" : "YYYY-MM-DD HH:mm Z", 
    "ignore_watch" : ["[\\/\\\\]\\./", "node_modules"], 
    "watch"  : true, 
    "node_args" : "--harmony", 
    "cwd"   : "/root/src/test_v2", 
    "env": { 
     "NODE_ENV": "production", 
     "AWESOME_SERVICE_API_TOKEN": "xxx", 
     "TZ": "America/Los_Angeles" 
    } 
    }] 
} 

要更改时区,我曾跟随截至https://github.com/Unitech/pm2/issues/560

评论,但它不工作。行为与认为“TZ”不存在的行为相同。我甚至努力将时区编码为数字值,如“+08:00”,这不起作用。如何更改日志中的时区。

回答

0

log_date_format in直接与momentjs在pm2 - source一起使用。

The following选项可用。

我不认为时区已经以任何方式实施,但您可以删除Z并使用时间为UTC

如果您确实需要时区实现,请在pm2上触发功能问题。