Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tls-forward
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
tls-forward
Commits
924851fd
Commit
924851fd
authored
Aug 02, 2024
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cronet
parent
6b8c80d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
main.go
main.go
+15
-15
No files found.
main.go
View file @
924851fd
...
...
@@ -5,7 +5,7 @@ import (
nested
"github.com/antonfisher/nested-logrus-formatter"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"
gopkg.in/natefinch/lumberjack.v2
"
"
os
"
"time"
"tls-forward/tls"
)
...
...
@@ -32,21 +32,21 @@ func main() {
//
//}
logWriter
:=
&
lumberjack
.
Logger
{
// 日志输出文件路径
Filename
:
"/data/log/tls-forward/tls2.log"
,
// 日志文件最大 size, 单位是 MB
MaxSize
:
100
,
// megabytes
// 最大过期日志保留的个数
MaxBackups
:
3
,
// 保留过期文件的最大时间间隔,单位是天
MaxAge
:
28
,
//days
// 是否需要压缩滚动日志, 使用的 gzip 压缩
Compress
:
true
,
// disabled by default
}
logrus
.
SetOutput
(
logWriter
)
//
logWriter := &lumberjack.Logger{
//
// 日志输出文件路径
//
Filename: "/data/log/tls-forward/tls2.log",
//
// 日志文件最大 size, 单位是 MB
//
MaxSize: 100, // megabytes
//
// 最大过期日志保留的个数
//
MaxBackups: 3,
//
// 保留过期文件的最大时间间隔,单位是天
//
MaxAge: 28, //days
//
// 是否需要压缩滚动日志, 使用的 gzip 压缩
//
Compress: true, // disabled by default
//
}
//
logrus.SetOutput(logWriter)
//logrus.SetOutput(io.MultiWriter(logWriter, os.Stdout))
//
logrus.SetOutput(os.Stdout)
logrus
.
SetOutput
(
os
.
Stdout
)
fmt
.
Println
(
"VERSION 1.0.1"
)
r
:=
gin
.
New
()
//创建一个默认的路由引擎
r
.
Use
(
LoggerMiddleware
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment