Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLogIndexExisted(client *elastic.Client, index string) bool
- func CreateElasticClient(url string) error
- func CreateLogIndex(client *elastic.Client, index string) error
- func InitElastic(params map[string]interface{}) error
- func RegisterService(serviceName string, service *LogService)
- func SendElasticDebug(message string, params ...interface{}) error
- func SendElasticError(err error, params ...interface{}) error
- func SendElasticFatal(message string, params ...interface{}) error
- func SendElasticMessage(message string, params ...interface{}) error
- func SendElasticWarning(message string, params ...interface{}) error
- func SendMessageToElastic(message, level string) error
- func ValidateElasticClient() error
- type CaptureDebug
- type CaptureError
- type CaptureFatal
- type CaptureMessage
- type CaptureWarning
- type InitService
- type LogService
- type MessageData
Constants ¶
View Source
const ( SENTRY_LOG_SERVICENAME = "sentry" ELASTIC_LOG_SERVICENAME = "elastic" INFO_LEVEL = "info" ERROR_LEVEL = "error" WARNING_LEVEL = "warning" DEBUG_LEVEL = "debug" FATAL_LEVEL = "fatal" )
View Source
const LOG_AGGREGATION_INDEX = "log_aggregation"
Variables ¶
View Source
var ELASTIC_URL = os.Getenv("ELASTIC_URL")
View Source
var LogServices = make(map[string]*LogService)
View Source
var SENTRY_DSN = os.Getenv("SENTRY_DSN")
Functions ¶
func CheckLogIndexExisted ¶
CHECK ELASTIC TABLE LOG INDEX EXIST
func CreateElasticClient ¶
func InitElastic ¶
func RegisterService ¶
func RegisterService(serviceName string, service *LogService)
func SendElasticDebug ¶
func SendElasticError ¶
func SendElasticFatal ¶
func SendElasticMessage ¶
func SendElasticWarning ¶
func SendMessageToElastic ¶
func ValidateElasticClient ¶
func ValidateElasticClient() error
Types ¶
type CaptureDebug ¶
type CaptureError ¶
type CaptureFatal ¶
type CaptureMessage ¶
type CaptureWarning ¶
type InitService ¶
type LogService ¶
type LogService struct { InitService InitService CaptureMessage CaptureMessage CaptureError CaptureError CaptureDebug CaptureDebug CaptureWarning CaptureWarning CaptureFatal CaptureFatal }
func GetService ¶
func GetService(serviceName string) (*LogService, error)
Click to show internal directories.
Click to hide internal directories.