func (f *Filter) buildAccessLogData(_ protocol.Invoker, invocation protocol.Invocation) map[string]string {
	dataMap := make(map[string]string, 16)
	attachments := invocation.Attachments()
	itf := attachments[constant.INTERFACE_KEY]
	if itf == nil || len(itf.(string)) == 0 {
		itf = attachments[constant.PATH_KEY]
	}
	if itf != nil {
		dataMap[constant.INTERFACE_KEY] = itf.(string)
	}
	if v, ok := attachments[constant.METHOD_KEY]; ok && v != nil {
		dataMap[constant.METHOD_KEY] = v.(string)
	}
	if v, ok := attachments[constant.VERSION_KEY]; ok && v != nil {
		dataMap[constant.VERSION_KEY] = v.(string)
	}
	if v, ok := attachments[constant.GROUP_KEY]; ok && v != nil {
		dataMap[constant.GROUP_KEY] = v.(string)
	}
	if v, ok := attachments[constant.TIMESTAMP_KEY]; ok && v != nil {
		dataMap[constant.TIMESTAMP_KEY] = v.(string)
	}
	if v, ok := attachments[constant.LOCAL_ADDR]; ok && v != nil {
		dataMap[constant.LOCAL_ADDR] = v.(string)
	}
	if v, ok := attachments[constant.REMOTE_ADDR]; ok && v != nil {
		dataMap[constant.REMOTE_ADDR] = v.(string)
	}
	if len(invocation.Arguments()) > 0 {
		builder := strings.Builder{}
		typeBuilder := strings.Builder{}
		builder.WriteString(reflect.ValueOf(invocation.Arguments()[0]).String())
		typeBuilder.WriteString(reflect.TypeOf(invocation.Arguments()[0]).Name())
		for idx := 1; idx < len(invocation.Arguments()); idx++ {
			arg := invocation.Arguments()[idx]
			builder.WriteString(",")
			builder.WriteString(reflect.ValueOf(arg).String())
			typeBuilder.WriteString(",")
			typeBuilder.WriteString(reflect.TypeOf(arg).Name())
		}
		dataMap[Arguments] = builder.String()
		dataMap[Types] = typeBuilder.String()
	}
	return dataMap
}
buildAccessLogData builds the access log data
package accesslog
import (
	"context"
	"os"
	"reflect"
	"strings"
	"time"
)
import (
	"dubbo.apache.org/dubbo-go/v3/common/constant"
	"dubbo.apache.org/dubbo-go/v3/common/extension"
	"dubbo.apache.org/dubbo-go/v3/common/logger"
	"dubbo.apache.org/dubbo-go/v3/filter"
	"dubbo.apache.org/dubbo-go/v3/protocol"
)
const (
	FileDateFormat = "2006-01-02"
	MessageDateLayout = "2006-01-02 15:04:05"
	LogMaxBuffer = 5000
	LogFileMode = 0o600
	Types = "types"
	Arguments = "arguments"
)
func init() {
	extension.SetFilter(constant.AccessLogFilterKey, newFilter)
}
type Filter struct {
	logChan chan Data
}
func (f *Filter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
	accessLog := invoker.GetURL().GetParam(constant.AccessLogFilterKey, "")
	if len(accessLog) > 0 {
		accessLogData := Data{data: f.buildAccessLogData(invoker, invocation), accessLog: accessLog}
		f.logIntoChannel(accessLogData)
	}
	return invoker.Invoke(ctx, invocation)
}
func (f *Filter) logIntoChannel(accessLogData Data) {
	select {
	case f.logChan <- accessLogData:
		return
	default:
		logger.Warn("The channel is full and the access logIntoChannel data will be dropped")
		return
	}
}