1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 14:50:55 +00:00

fix function changes

This commit is contained in:
DennisMao 2019-01-02 17:01:46 +08:00
parent 6e16b8cdcf
commit edb1c52dee

View File

@ -8,8 +8,8 @@ import (
"net/url" "net/url"
"time" "time"
"github.com/astaxie/beego/logs"
"github.com/OwnLocal/goes" "github.com/OwnLocal/goes"
"github.com/astaxie/beego/logs"
) )
// NewES return a LoggerInterface // NewES return a LoggerInterface
@ -21,7 +21,7 @@ func NewES() logs.Logger {
} }
type esLogger struct { type esLogger struct {
*goes.Connection *goes.Client
DSN string `json:"dsn"` DSN string `json:"dsn"`
Level int `json:"level"` Level int `json:"level"`
} }
@ -41,8 +41,8 @@ func (el *esLogger) Init(jsonconfig string) error {
} else if host, port, err := net.SplitHostPort(u.Host); err != nil { } else if host, port, err := net.SplitHostPort(u.Host); err != nil {
return err return err
} else { } else {
conn := goes.NewConnection(host, port) conn := goes.NewClient(host, port)
el.Connection = conn el.Client = conn
} }
return nil return nil
} }
@ -78,3 +78,4 @@ func (el *esLogger) Flush() {
func init() { func init() {
logs.Register(logs.AdapterEs, NewES) logs.Register(logs.AdapterEs, NewES)
} }