Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic rotate log #84

Merged
merged 4 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions examples/app/configs/application.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@
bizType = 1 #business type

[log]
name = "run.log"
dir = "."
addCaller = true
callerSkip = 1
level = "debug"
#outputPath = ["stdout","./logs/run.log"]
outputPath = ["stdout"]
errorOutputPath = ["stderr"]
callerSkip = 1
flushInterval= "1s"
debug = true
enableAsyncLog = false
disableStacktrace = false
maxSize = 500 # maximum 500M log size
maxAge = 30 # retain maximum 30 days
maxBackup = 100 # retian maximum 100 log
watchConfig = true

[trace]
Expand Down
2 changes: 1 addition & 1 deletion examples/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func main() {
config.FlowRules,
&flow.Rule{
Resource: "GET:/api/ping",
Threshold: 1.0,
Threshold: 1000.0,
TokenCalculateStrategy: flow.Direct,
ControlBehavior: flow.Reject,
StatIntervalInMs: 1000,
Expand Down
15 changes: 7 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ require (
github.com/Shopify/sarama v1.27.0
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/UnderTreeTech/protobuf v0.0.0-20210114031945-c3954be20f41
github.com/alibaba/sentinel-golang v1.0.0-M2
github.com/alibaba/sentinel-golang v1.0.2
github.com/apache/rocketmq-client-go/v2 v2.0.0
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gin-gonic/gin v1.7.1
github.com/gin-gonic/gin v1.7.2
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-playground/assert/v2 v2.0.1
github.com/go-playground/validator/v10 v10.4.1
Expand All @@ -30,31 +30,31 @@ require (
github.com/json-iterator/go v1.1.10 // indirect
github.com/lib/pq v1.8.0
github.com/mitchellh/mapstructure v1.3.3
github.com/natefinch/lumberjack v0.0.0-20201021141957-47ffae23317c
github.com/olivere/elastic v6.2.35+incompatible // indirect
github.com/olivere/elastic/v7 v7.0.22
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.1.3 // indirect
github.com/qiniu/qmgo v0.9.2-0.20210116045627-f966f5d97284
github.com/qiniu/qmgo v0.9.4
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc // indirect
github.com/uber/jaeger-client-go v2.25.0+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
github.com/urfave/cli/v2 v2.2.0
go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698
go.mongodb.org/mongo-driver v1.4.0
go.uber.org/zap v1.15.0
go.mongodb.org/mongo-driver v1.5.1
go.uber.org/zap v1.18.1
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect
golang.org/x/sys v0.0.0-20200817155316-9781c653f443 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1
Expand All @@ -64,5 +64,4 @@ require (
gopkg.in/olivere/elastic.v5 v5.0.86
gopkg.in/olivere/elastic.v6 v6.2.35
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)