You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-5Lines changed: 37 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,8 @@ $ docker run -d \
56
56
blacklabelops/logrotate
57
57
~~~~
58
58
59
+
> This will logrotate any logfile(s) under /var/lib/docker/containers, /var/log/docker (or subdirectories of them).
60
+
59
61
# Customize Log File Ending
60
62
61
63
You can define the file endings fluentd will attach to. The container will by default crawl for
@@ -97,6 +99,8 @@ $ docker run -d \
97
99
blacklabelops/logrotate
98
100
~~~~
99
101
102
+
> This will logrotate logfile(s) on hourly basis.
103
+
100
104
# Set the Number of Rotations
101
105
102
106
The default number of rotations is five. Further rotations will delete old logfiles. You
@@ -135,6 +139,8 @@ $ docker run -d \
135
139
blacklabelops/logrotate
136
140
~~~~
137
141
142
+
> This will logrotate when logfile(s) reaches 10M+.
143
+
138
144
# Set Log File compression
139
145
140
146
The default logrotate setting is `nocompress`. In order to enable logfile compression
@@ -151,6 +157,8 @@ $ docker run -d \
151
157
blacklabelops/logrotate
152
158
~~~~
153
159
160
+
> This will compress the logrotated logs.
161
+
154
162
# Set the Output directory
155
163
156
164
By default, logrotate will rotate logs in their respective directories. You can
@@ -187,6 +195,8 @@ $ docker run -d \
187
195
blacklabelops/logrotate
188
196
~~~~
189
197
198
+
> This will logrotate on go-cron schedule \*\*\*\*\*\* (every second).
199
+
190
200
# Log and View the Logrotate Output
191
201
192
202
You can specify a logfile for the periodical logrotate execution. The file
@@ -206,7 +216,7 @@ $ docker run -d \
206
216
blacklabelops/logrotate
207
217
~~~~
208
218
209
-
> You will be able to see logrotate output every minute in file logs/logrotatecron.log
219
+
> You will be able to see logrotate output every minute in file logs/logrotatecron.log.
210
220
211
221
# Logrotate Commandline Parameters
212
222
@@ -270,12 +280,11 @@ $ docker run -d \
270
280
blacklabelops/logrotate
271
281
~~~~
272
282
273
-
> You will be able to see cron output every minute in file logs/cron.log
274
-
283
+
> You will be able to see cron output every minute in file logs/cron.log.
275
284
276
285
# Setting a Date Extension
277
286
278
-
With Logrotate it is possible to split files and name them by the date they were generated when used with `LOGROTATE_CRONSCHEDULE`. By setting `LOGROTATE_DATEFORMAT` you will enable the Logrotate `dateext` option.
287
+
With Logrotate it is possible to split files and name them by the date they were generated when used with `LOGROTATE_DATEFORMAT`. By setting `LOGROTATE_DATEFORMAT` you will enable the Logrotate `dateext` option.
279
288
280
289
The default Logrotate format is `-%Y%m%d`, to enable the defaults `LOGROTATE_DATEFORMAT` should be set to this.
281
290
@@ -292,6 +301,8 @@ $ docker run -d \
292
301
blacklabelops/logrotate
293
302
~~~~
294
303
304
+
> This will set logrotate to split files and name them by date format -%Y%m%d.
305
+
295
306
# Disable Auto Update
296
307
297
308
With Logrotate by default it auto update its logrotate configuration file to ensure it only captures all the intended log file in the `LOGS_DIRECTORIES` (before it rotates the log files). It is possible to disable auto update when used with `LOGROTATE_AUTOUPDATE`. By setting `LOGROTATE_AUTOUPDATE` (to not equal true) you will disable the auto update of Logrotate.
@@ -309,9 +320,30 @@ docker run -d \
309
320
blacklabelops/logrotate
310
321
~~~~
311
322
323
+
> This will disable logrotate configuration file update (when logrotate action is triggering).
324
+
325
+
# Set Time Zone
326
+
327
+
With Logrotate by default it logrotate logs in `UTC` time zone. It is possible to set time zone when used with `TZ`. By setting `TZ` (to a valid time zone) it will logrotate logs in the specified time zone.
328
+
329
+
The default `TZ` is `""`, to set to different time zone. E.g `Australia/Melbourne`.
0 commit comments