-
Notifications
You must be signed in to change notification settings - Fork 11
/
timber.json
82 lines (82 loc) · 2.87 KB
/
timber.json
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"filters": [
{
"enabled": true,
"tag": "stderr",
"type": "console",
"level": "DEBUG",
"_level_comment": [
"Levels are FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR"
],
"granulars": [
{
"level": "FINEST",
"path": "path/to/package"
},
{
"level": "FINEST",
"path": "path/to/package.FunctionName"
}
],
"format": {
"name": "pattern",
"value": "[%D %T] %L %M"
},
"_format_comment": [
"Format codes: ",
"%T - Time: 17:24:05.333 HH:MM:SS.ms ",
"%t - Time: 17:24:05 HH:MM:SS ",
"%D - Date: 2011-12-25 yyyy-mm-dd ",
"%d - Date: 2011/12/25 ",
"%L - Level (FNST, FINE, DEBG, TRAC, WARN, EROR, CRIT) ",
"%S - Source: full runtime.Caller line ",
"%s - Short Source: just file and line number ",
"%x - Extra Short Source: just file without .go suffix ",
"%M - Message ",
"%% - Percent sign ",
"%P - package.FunctionName ",
"%p - package ",
"the string number prefixes are allowed e.g.: %10s will pad the source field to 10 spaces ",
"pattern defaults to %M ",
"Setting formats can be either through filter.format or through a filter.properties item, ",
"but only support the above formats(Example included below) "
]
},
{
"enabled": true,
"tag": "file",
"type": "file",
"level": "FINEST",
"properties": [
{
"name": "filename",
"value": "timber_test.log"
},
{
"name": "format",
"value": "[%D %T] [%L] %M"
}
]
},
{
"enabled": true,
"tag": "syslog",
"type": "socket",
"level": "FINEST",
"properties": [
{
"name": "protocol",
"value": "udp"
},
{
"name": "endpoint",
"value": "localhost:9500"
},
{
"name": "format",
"value": "%L %M"
}
]
}
]
}