Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationInsightsCore ¶
func ApplicationInsightsCore(cfg *AppInsightsConfig) (zapcore.Core, func(), error)
ApplicationInsightsCore builds a zapcore.Core that sends logs to Application Insights. The first return is the core, the second is a function to close the sink.
Types ¶
type AppInsightsConfig ¶
type AppInsightsConfig struct {
Level string `json:"level"`
IKey string `json:"ikey"`
GracePeriod time.Duration `json:"grace_period"`
MaxBatchInterval time.Duration `json:"max_batch_interval"`
MaxBatchSize int `json:"max_batch_size"`
Fields []zapcore.Field `json:"fields"`
// contains filtered or unexported fields
}
func (*AppInsightsConfig) UnmarshalJSON ¶
func (c *AppInsightsConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for the Config. It only differs from the default by parsing the Level string into a zapcore.Level and setting the level field.
type FileConfig ¶
type FileConfig struct {
Filepath string `json:"filepath"`
Level string `json:"level"`
MaxBackups int `json:"maxBackups"`
MaxSize int `json:"maxSize"`
// contains filtered or unexported fields
}
func (*FileConfig) UnmarshalJSON ¶
func (cfg *FileConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for the Config. It only differs from the default by parsing the Level string into a zapcore.Level and setting the level field.
Click to show internal directories.
Click to hide internal directories.