accesslog

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package accesslog providers logging filter.

Index

Constants

View Source
const (
	// used in URL.
	// nolint
	FileDateFormat = "2006-01-02"
	// nolint
	MessageDateLayout = "2006-01-02 15:04:05"
	// nolint
	LogMaxBuffer = 5000
	// nolint
	LogFileMode = 0o600

	// nolint
	Types = "types"
	// nolint
	Arguments = "arguments"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data defines the data that will be log into file

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter for Access Log *

  • Although the access log filter is a default filter,
  • you should config "accesslog" in service's config to tell the filter where store the access log.
  • for example:
  • "UserProvider":
  • registry: "hangzhouzk"
  • protocol : "dubbo"
  • interface : "com.ikurento.user.UserProvider"
  • ... # other configuration
  • accesslog: "/your/path/to/store/the/log/", # it should be the path of file. *
  • the value of "accesslog" can be "true" or "default" too.
  • If the value is one of them, the access log will be record in log file which defined in log.yml
  • AccessLogFilter is designed to be singleton

func (*Filter) Invoke

func (f *Filter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result

Invoke will check whether user wants to use this filter. If we find the value of key constant.AccessLogFilterKey, we will log the invocation info

func (*Filter) OnResponse

OnResponse do nothing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL