1

我在 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
4

1 回答 1

2

虽然最初我认为这是我们这边的问题,但 Loggly 的支持人员承认他们对 Heroku 日志的解析存在问题,并且他们正在努力解决这个问题。

我一直保持这个问题,直到 Loggly 解决这个问题,以防其他人搜索它。一旦 Loggly 修复它,我将删除该问题。

于 2014-08-28T15:34:10.300 回答