Documentation ¶
Index ¶
- Constants
- func Default() nirvana.Configurer
- func Disable() nirvana.Configurer
- func DoubleLog(enable bool) nirvana.Configurer
- func Logger(l log.Logger) nirvana.Configurer
- func RequestID(enable bool) nirvana.Configurer
- func RequestIDKey(key string) nirvana.Configurer
- func SourceAddr(enable bool) nirvana.Configurer
- type Option
Constants ¶
const ExternalConfigName = "reqlog"
ExternalConfigName is the external config name of request logger.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default() nirvana.Configurer
Default Configurer does nothing but ensure default config was set.
func DoubleLog ¶
func DoubleLog(enable bool) nirvana.Configurer
DoubleLog returns a configurer to enable or disable double log. If it's enabled, every request outputs two entries. One for starting and another for ending. If it's disabled, only outputs ending entry. Defaults to false.
func RequestID ¶
func RequestID(enable bool) nirvana.Configurer
RequestID returns a configurer to enable or disable showing request id. Defaults to false.
func RequestIDKey ¶
func RequestIDKey(key string) nirvana.Configurer
RequestIDKey returns a configurer to set header key of request id. Defaults to X-Request-Id.
func SourceAddr ¶
func SourceAddr(enable bool) nirvana.Configurer
SourceAddr returns a configurer to enable or disable showing source addr. Defaults to false.
Types ¶
type Option ¶
type Option struct { DoubleLog bool `desc:"Output two entries for every request"` SourceAddr bool `desc:"Output source addr for request log"` RequestID bool `desc:"Output request id for request log"` RequestIDKey string `desc:"Request header key for request id"` }
Option contains basic configurations of reqlog.