accesslog

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Package accesslog providers logging filter.

Index

Constants

View Source
const (
	// used in URL.
	// FileDateFormat is the date format used for file rotation.
	FileDateFormat = "2006-01-02"
	// MessageDateLayout is the datetime layout used in log message.
	MessageDateLayout = "2006-01-02 15:04:05"
	// LogMaxBuffer is the max buffered log items.
	LogMaxBuffer = 5000
	// LogFileMode is the file permission for access log files.
	LogFileMode = 0o600

	// Types represents the list of argument types in log.
	Types = "types"
	// Arguments represents the arguments string in log.
	Arguments = "arguments"
)

Variables

This section is empty.

Functions

func Shutdown added in v3.3.1

func Shutdown()

Shutdown gracefully shuts down the access log filter This should be called during application shutdown to prevent goroutine leaks

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 base.Invoker, invocation base.Invocation) result.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

func (f *Filter) OnResponse(_ context.Context, result result.Result, _ base.Invoker, _ base.Invocation) result.Result

OnResponse do nothing

Jump to

Keyboard shortcuts

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