2016-09-21 18 views
1

注意:這隻發生在我有多個「進程」的應用程序中。在這種情況下,我使用Resque,所以我得到一個讀取隊列,一個在隊列中運行作業。如何縮短heroku日誌的時間戳?

這只是我運行heroku logs時的日誌示例。有誰知道爲什麼時間戳會重複兩次?有禁用選項嗎?我看着Heroku文檔並沒有看到任何文檔。 https://devcenter.heroku.com/articles/logging

2016-09-21T05:12:34.858759+00:00 app[web.1]: I, [2016-09-21T05:12:34.858696 #3] INFO -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] Completed 
    500 Internal Server Error in 2ms (ActiveRecord: 0.0ms) 
    2016-09-21T05:12:34.860088+00:00 app[web.1]: F, [2016-09-21T05:12:34.860032 #3] FATAL -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] 
    2016-09-21T05:12:34.854247+00:00 app[web.1]: I, [2016-09-21T05:12:34.854153 #3] INFO -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] Started POST "/request_jobs" for 72.89.67.94 at 2016-09-21 05:12:34 +0000 
    2016-09-21T05:12:34.860164+00:00 app[web.1]: F, [2016-09-21T05:12:34.860113 #3] FATAL -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] Redis::CannotConnectError (Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)): 
    2016-09-21T05:12:34.860223+00:00 app[web.1]: F, [2016-09-21T05:12:34.860183 #3] FATAL -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] 
    2016-09-21T05:12:34.860300+00:00 app[web.1]: F, [2016-09-21T05:12:34.860239 #3] FATAL -- : [ee72ed1c-fd13-466b-a463-351584a99ad7] app/controllers/hunter_controller.rb:9:in `request_jobs' 

回答

1

我問過類似的問題,並得到了對我的工作有很大答案:

heroku logs | cut -d "]" -f4

似乎去4個空格在最後收盤括號前,切去它之前的一切。

希望它可以幫助你!