2015-02-06 129 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上觸發功能問題。