1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-15 02:30:39 +00:00

LogFormatter Implementation

This commit is contained in:
IamCathal
2020-08-20 19:00:35 +01:00
parent 9003ca3eef
commit 6bdedff457
10 changed files with 62 additions and 5 deletions

View File

@ -35,6 +35,10 @@ type esLogger struct {
Level int `json:"level"`
}
func (el *esLogger) Format(lm *logs.LogMsg) string {
return lm.Msg
}
// {"dsn":"http://localhost:9200/","level":1}
func (el *esLogger) Init(jsonconfig string) error {
err := json.Unmarshal([]byte(jsonconfig), el)