Documentation
¶
Index ¶
- func NewAliyunLogger(config *SlsConfig) log.Logger
- func NewDefaultHelper(logger log.Logger) *log.Helper
- func NewLogger(config *LogConfig, slsConfig *SlsConfig) log.Logger
- func NewLoggerHelper(logger log.Logger, module string, path string) *log.Helper
- func NewTestLogger() *log.Helper
- func Trace() log.Valuer
- type LogConfig
- type Logger
- type Option
- func WithAccessKey(ak string) Option
- func WithAccessSecret(as string) Option
- func WithEndpoint(endpoint string) Option
- func WithLogStore(logStore string) Option
- func WithProject(project string) Option
- func WithRegion(region string) Option
- func WithSource(source string) Option
- func WithTopic(topic string) Option
- type SlsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAliyunLogger ¶
func NewLoggerHelper ¶
func NewTestLogger ¶
Types ¶
type LogConfig ¶
type LogConfig struct {
Level int `json:"level"`
Output string `json:"output"`
Formatter string `json:"formatter"`
FileOpen bool `json:"fileOpen"`
FilePath string `json:"filePath"`
ElasticOpen bool `json:"elasticOpen"`
ElasticIndex string `json:"elasticIndex"`
ElasticLevel string `json:"elasticLevel"`
Channel []string `json:"channel"`
RequestLog bool `json:"requestLog"`
RequestLogType string `json:"requestLogType"`
}
type Logger ¶
Logger see more detail https://github.com/aliyun/aliyun-log-go-sdk
func NewAliyunLog ¶
NewAliyunLog new aliyun logger with options.
type Option ¶
type Option func(alc *options)
func WithAccessKey ¶
func WithAccessSecret ¶
func WithEndpoint ¶
func WithLogStore ¶
func WithProject ¶
func WithRegion ¶
func WithSource ¶
type SlsConfig ¶
type SlsConfig struct {
Endpoint string `json:"endpoint"`
AccessKey string `json:"accessKey"`
AccessKeyId string `json:"accessKeyId"`
AccessSecret string `json:"accessSecret"`
AccessKeySecret string `json:"accessKeySecret"`
LogStore string `json:"logStore"`
LogStoreName string `json:"logStoreName,"`
Region string `json:"region"`
Project string `json:"project"`
ProjectName string `json:"projectName"`
}
Click to show internal directories.
Click to hide internal directories.