Skip to content

Commit 154cd33

Browse files
committed
日志输出到 es、syslog
1 parent 2daa105 commit 154cd33

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

pkg/logging/log.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ package logging
66
import (
77
"bufio"
88
"fmt"
9+
"log/syslog"
10+
"os"
11+
"path"
12+
"path/filepath"
13+
914
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
1015
es6 "github.com/olivere/elastic"
1116
es7 "github.com/olivere/elastic/v7"
@@ -14,10 +19,6 @@ import (
1419
prefixed "github.com/x-cray/logrus-prefixed-formatter"
1520
els6 "gopkg.in/sohlich/elogrus.v3"
1621
els7 "gopkg.in/sohlich/elogrus.v7"
17-
"log/syslog"
18-
"os"
19-
"path"
20-
"path/filepath"
2122
)
2223

2324
var (

pkg/logging/log_win.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
package logging
55

66
import (
7+
"bufio"
8+
"fmt"
9+
"os"
10+
"path"
11+
"path/filepath"
12+
713
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
814
es6 "github.com/olivere/elastic"
915
es7 "github.com/olivere/elastic/v7"
1016
"github.com/sirupsen/logrus"
1117
prefixed "github.com/x-cray/logrus-prefixed-formatter"
1218
els6 "gopkg.in/sohlich/elogrus.v3"
1319
els7 "gopkg.in/sohlich/elogrus.v7"
14-
"os"
15-
"path"
16-
"path/filepath"
1720
)
1821

1922
var (

0 commit comments

Comments
 (0)