-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog.conf
More file actions
30 lines (30 loc) · 1.1 KB
/
log.conf
File metadata and controls
30 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 備註說明:備註不能寫在後面,只能單行由#開頭
# Level : debug, info, notice, warn, error, critical(fatal)
# MaxSize : size * mb
# Color : 只有在console才會生效
# DateSlice : d:天, h:小時
# Format :
# %{id} Sequence number for log message (uint64).
# %{pid} Process id (int)
# %{time} Time when log occurred (time.Time) ex:%{time:2006/01/02 15:04:05.000}
# %{level} Log level (Level)
# %{module} Module (string)
# %{program} Basename of os.Args[0] (string)
# %{message} Message (string)
# %{longfile} Full file name and line number: /a/b/c/d.go:23
# %{shortfile} Final file name element and line number: d.go:23
# %{callpath} Callpath like main.a.b.c...c "..." meaning recursive call ~. meaning truncated path
# %{color} ANSI color based on log level 不知道什麼時候才有效果
{
"Level": "DEBUG",
"FileName":"./logs/log.log",
"LevelFileName": {
"error": "./logs/error.log"
},
"HasConsole": true,
"Color": true,
"MaxSize": 100,
"MaxAge": 2,
"DateSlice": "d",
"Format": "%{time:2006/01/02 15:04:05.000} %{shortfile} [%{level:.4s}] %{message}"
}