Documentation ¶
Index ¶
- Constants
- type Config
- type Logger
- func (log *Logger) GetConfig() *Config
- func (log *Logger) LogHTTPInRequest(ctx context.Context, req *http.Request) error
- func (log *Logger) LogHTTPInResponse(ctx context.Context, resp *http.Response) error
- func (log *Logger) LogHTTPOutRequest(ctx context.Context, req *http.Request) error
- func (log *Logger) LogHTTPOutResponse(ctx context.Context, header map[string]string, responseBuf []byte, status int) error
- func (log *Logger) SetConfig(cfg *Config) error
- func (log *Logger) Shutdown() (myerr error)
Constants ¶
View Source
const LOG_DEF_FILE_NAME = "./httplog/http.log"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Enable bool `yaml:"enable" json:"enable"` // состояние логирования 'true', 'false' LogInReq bool `yaml:"log_in_req" json:"log_in_req"` // логировать входящие запросы LogOutReq bool `yaml:"log_out_req" json:"log_out_req"` // логировать исходящие запросы LogInResp bool `yaml:"log_in_resp" json:"log_in_resp"` // логировать входящие ответы LogOutResp bool `yaml:"log_out_resp" json:"log_out_resp"` // логировать исходящие ответы LogBody bool `yaml:"log_body" json:"log_body"` // логировать тело запроса FileConfig *_log.FileConfig `json:"file" yaml:"file"` // конфигурация для логирования в файл, если имя файла пустое, то используется глобальное }
Config represent аn HTTP logger config
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represent аn HTTP logger
func (*Logger) LogHTTPInRequest ¶
LogHTTPInRequest process HTTP logging for In request
func (*Logger) LogHTTPInResponse ¶
LogHTTPInResponse process HTTP logging for In response
func (*Logger) LogHTTPOutRequest ¶
LogHTTPOutRequest process HTTP logging for Out request
func (*Logger) LogHTTPOutResponse ¶
func (log *Logger) LogHTTPOutResponse(ctx context.Context, header map[string]string, responseBuf []byte, status int) error
LogHTTPOutResponse process HTTP logging for Out Response
Click to show internal directories.
Click to hide internal directories.