Rails 3.2.2 log files unordered, requests intertwined

后端 未结 6 1015
礼貌的吻别
礼貌的吻别 2021-02-08 02:02

I recollect getting log files that were nicely ordered, so that you could follow one request, then the next, and so on.

Now, the log files are, as my 4 year old says \"a

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-08 02:21

    I haven't used it, but I believe Lumberjack's unit_of_work method may be what you're looking for. You call:

    Lumberjack.unit_of_work do
      yield
    end
    

    And all logging done either in that block or in the yielded block are tagged with a unique ID.

提交回复
热议问题