Rails logger format string configuration

后端 未结 4 1439
余生分开走
余生分开走 2020-12-01 08:36

How can I configure the rails logger to output its log strings in another format? I would like to get something that is more informative like:

[Log Level] [Time] [Me

4条回答
  •  Happy的楠姐
    2020-12-01 08:51

    The problem with tags is that they clutter your logs to the point where they are unreadable.

    I'd recommend something like timber. It automatically augments your logs with context (level, time, session id, etc) without sacrificing readability.

提交回复
热议问题