Skip to content

Commit 4fac6ce

Browse files
authored
Merge pull request beego#4039 from flycash/fixbug
Fix ES bug
2 parents 9dea9f9 + 1c4085e commit 4fac6ce

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Congratulations! You've just built your first **beego** app.
3333

3434
###### Please see [Documentation](http://beego.me/docs) for more.
3535

36+
###### [beego-example](https://github.com/beego-dev/beego-example)
37+
3638
## Features
3739

3840
* RESTful support

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ require (
2323
github.com/mattn/go-sqlite3 v2.0.3+incompatible
2424
github.com/pelletier/go-toml v1.2.0 // indirect
2525
github.com/pingcap/tidb v2.0.11+incompatible // indirect
26-
github.com/pkg/errors v0.8.0 // indirect
2726
github.com/prometheus/client_golang v1.7.0
2827
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644
2928
github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec
29+
github.com/stretchr/testify v1.4.0
3030
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c // indirect
3131
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b // indirect
3232
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFl
4040
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76 h1:Lgdd/Qp96Qj8jqLpq2cI1I1X7BJnu06efS+XkhRoLUQ=
4141
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
4242
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
43+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4344
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4445
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8=
4546
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
@@ -123,6 +124,7 @@ github.com/pingcap/tidb v2.0.11+incompatible/go.mod h1:I8C6jrPINP2rrVunTRd7C9fRR
123124
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
124125
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
125126
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
127+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
126128
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
127129
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
128130
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
@@ -158,6 +160,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
158160
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
159161
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
160162
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
163+
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
161164
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
162165
github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
163166
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c h1:3eGShk3EQf5gJCYW+WzA0TEJQd37HLOmlYF7N0YJwv0=

logs/es/es.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ func NewES() logs.Logger {
2323
return cw
2424
}
2525

26+
// esLogger will log msg into ES
27+
// before you using this implementation,
28+
// please import this package
29+
// usually means that you can import this package in your main package
30+
// for example, anonymous:
31+
// import _ "github.com/astaxie/beego/logs/es"
2632
type esLogger struct {
2733
*elasticsearch.Client
2834
DSN string `json:"dsn"`
@@ -43,7 +49,7 @@ func (el *esLogger) Init(jsonconfig string) error {
4349
return errors.New("missing prefix")
4450
} else {
4551
conn, err := elasticsearch.NewClient(elasticsearch.Config{
46-
Addresses: []string{u.Host},
52+
Addresses: []string{el.DSN},
4753
})
4854
if err != nil {
4955
return err

0 commit comments

Comments
 (0)