如何在logstash-logger

时间:2015-10-29 21:35:59

标签: ruby-on-rails logstash

我正在使用Logstash-logger。我想知道如何添加控制器名称或路由以自动出现在日志中。这是默认日志

      #production.log  
{
        "message":"  Couldn't find template for digesting: docs/#{@doc.layout}",
        "@timestamp":"2015-10-28T22:15:05.963+00:00",
        "@version":"1",
        "severity":"ERROR",
        "host":"localhost"
       }

预期

{
        "message":"  Couldn't find template for digesting: docs/#{@doc.layout}",
        "@timestamp":"2015-10-28T22:15:05.963+00:00",
        "@version":"1",
        "severity":"ERROR",
        "host":"localhost",
        "routes" : "AticlesController#index",
        #or from view
        "view": "Articles#index#_partial_name
       }

1 个答案:

答案 0 :(得分:0)

LogStashLogger的作者。我建议您查看LogstasherLograge宝石。他们都非常支持记录有关控制器和请求中涉及的视图的信息。