We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ad4a37 commit 4cba492Copy full SHA for 4cba492
example_test.go
@@ -0,0 +1,20 @@
1
+package timberjack
2
+
3
+import (
4
+ "log"
5
+ "time"
6
+)
7
8
+// To use timberjack with the standard library's log package, just pass it into
9
+// the SetOutput function when your application starts.
10
+func Example() {
11
+ log.SetOutput(&Logger{
12
+ Filename: "/var/log/myapp/foo.log",
13
+ MaxSize: 500, // megabytes
14
+ MaxBackups: 3, // number of backups
15
+ MaxAge: 28, // days
16
+ Compress: true, // disabled by default
17
+ LocalTime: true, // use the local timezone
18
+ RotationInterval: time.Hour * 24, // rotate daily
19
+ })
20
+}
0 commit comments