我正在Heroku上运行Flask应用。我已将日志输出连接到Loggly,但是尝试Loggly的验证步骤,我收到以下消息:
我们收到了您的日志,但他们似乎没有使用我们的日志 自动解析格式。请参阅我们的指南以了解更多信息(链接)。 你仍然可以进行全文搜索并依赖这些日志,但是你 无法使用某些功能,例如按字段过滤。
为什么Loggly没有很好地解析Heroku的日志?我能改变什么呢?
Heroku似乎是非常标准的日志,这是一个例子:
2014-08-26 11:06:00 [2] [INFO] 1 workers
2014-08-26 11:05:45 [2] [INFO] 1 workers
2014-08-26 11:05:16 [2] [INFO] 1 workers
at=info method=GET path="/" host=my-app.herokuapp.com request_id=925f3605-2ac4-4182-b148-987ab7d985c4 fwd="91.271.61.73" dyno=web.1 connect=1ms service=4ms status=200 bytes=608
Process exited with status 0
2014-08-26 11:04:47 [2] [INFO] Shutting down: Master
2014-08-26 11:04:47 [2] [INFO] 1 workers
2014-08-26 11:04:47 [2] [INFO] Handling signal: term
2014-08-26 11:04:47 [7] [INFO] Worker exiting (pid: 7)
State changed from starting to up
2014-08-26 11:04:46 [2] [INFO] 1 workers
2014-08-26 11:04:46 [7] [INFO] Booting worker with pid: 7
2014-08-26 11:04:46 [2] [INFO] Listening at: http://0.0.0.0:26268 (2)
2014-08-26 11:04:46 [2] [INFO] Using worker: sync
2014-08-26 11:04:46 [2] [INFO] Starting gunicorn 19.1.0
Stopping all processes with SIGTERM
Starting process with command `gunicorn service:app --log-file=-`
2014-08-26 11:04:44 [2] [INFO] 1 workers
at=info method=GET path="/" host=my-app.herokuapp.com request_id=e152c661-b633-4870-aeba-68cea3cc8039 fwd="73.24.16.159" dyno=web.1 connect=0ms service=13ms status=200 bytes=407
Slug compilation finished
State changed from up to starting
Release v10 created by my@email.com
Deploy be32f3c by my@email.com
2014-08-26 11:04:29 [2] [INFO] 1 workers
Slug compilation started
2014-08-26 11:04:14 [2] [INFO] 1 workers
2014-08-26 11:03:59 [2] [INFO] 1 workers
答案 0 :(得分:2)
虽然最初我认为这是我们方面的一个问题,但Loggly的支持承认他们解析Heroku日志存在问题并且他们正在研究它。
我一直保持这个问题,直到Loggly修复此问题以防其他人搜索它。一旦Loggly修复它,我将删除该问题。