我正在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
虽然最初我认为这是我们这边的问题,但Loggly的支持人员承认他们对Heroku日志的解析存在问题,他们正在解决这个问题。
在Logly解决这个问题之前,我一直保留这个问题,以防其他人搜索。一旦Logly解决了这个问题,我就会删除这个问题。