提交 dc698444 编写于 作者: Y Yves Senn

Merge pull request #19236 from sshaw/more_tagged_logging_docs

More docs on tagged logging [ci skip]
......@@ -114,7 +114,7 @@ numbers. New applications filter out passwords by adding the following `config.f
defaults to `:debug` for all environments. The available log levels are: `:debug`,
`:info`, `:warn`, `:error`, `:fatal`, and `:unknown`.
* `config.log_tags` accepts a list of methods that the `request` object responds to. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications.
* `config.log_tags` accepts a list of: methods that the `request` object responds to, a `Proc` that accepts the `request` object, or something that responds to `to_s`. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications.
* `config.logger` accepts a logger conforming to the interface of Log4r or the default Ruby `Logger` class. Defaults to an instance of `ActiveSupport::Logger`.
......
......@@ -7,6 +7,9 @@
module Rails
module Rack
# Sets log tags, logs the request, calls the app, and flushes the logs.
#
# Log tags (+taggers+) can be an Array containing: methods that the <tt>request</tt> object responds to, a Proc
# that accepts an instance of the <tt>request</tt> object, or something that responds to <tt>to_s</tt>.
class Logger < ActiveSupport::LogSubscriber
def initialize(app, taggers = nil)
@app = app
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册