Commit 462f805
committed
refactor: consolidate log files and clean up obsolete artifacts
Trim the logger from 8 file transports per version to 3:
- application-%DATE%.log: single daily-rotated JSON file at debug
level, capturing the full error/warn/info/verbose/debug stream
(the previous combined.log, application-%DATE%.log, and
debug-%DATE%.log all wrote overlapping subsets of this)
- exceptions-%DATE%.log: unhandled exceptions, daily-rotated
- rejections-%DATE%.log: unhandled promise rejections, daily-rotated
Removed transports:
- error.log (unbounded; its data was already in combined.log /
application-%DATE%.log / debug-%DATE%.log)
- combined.log (unbounded; pure duplicate of application-%DATE%.log)
- debug-%DATE%.log (superseded by application-%DATE%.log at debug
level)
- exceptions.log and rejections.log (unbounded duplicates of the
rotated siblings)
All remaining rotated transports now carry maxFiles: '30d', capping
disk usage at roughly 600 MB per logger version instead of growing
without bound.
To avoid leaving old files sitting around forever on hosts upgrading
across CADT versions, startup now deletes the superseded files from
the log directory:
error.log, combined.log, exceptions.log, rejections.log,
and debug-%DATE%.log{,.N,.gz}
Cleanup is best-effort; missing files are ignored and per-file errors
are logged rather than thrown, so a cleanup problem can never take
down startup. Journalctl / pm2 / docker continue to be the primary
real-time log consumers.1 parent e2ac103 commit 462f805
1 file changed
Lines changed: 95 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 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 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
35 | 107 | | |
36 | 108 | | |
37 | 109 | | |
| |||
44 | 116 | | |
45 | 117 | | |
46 | 118 | | |
| 119 | + | |
| 120 | + | |
47 | 121 | | |
48 | 122 | | |
49 | 123 | | |
| |||
52 | 126 | | |
53 | 127 | | |
54 | 128 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
64 | 133 | | |
65 | 134 | | |
66 | 135 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 136 | | |
76 | 137 | | |
77 | | - | |
| 138 | + | |
| 139 | + | |
78 | 140 | | |
79 | 141 | | |
80 | 142 | | |
81 | 143 | | |
82 | 144 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 145 | | |
87 | 146 | | |
88 | 147 | | |
89 | 148 | | |
90 | | - | |
| 149 | + | |
| 150 | + | |
91 | 151 | | |
92 | 152 | | |
93 | 153 | | |
94 | 154 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 155 | | |
99 | 156 | | |
100 | 157 | | |
101 | 158 | | |
102 | | - | |
| 159 | + | |
| 160 | + | |
103 | 161 | | |
104 | 162 | | |
105 | 163 | | |
| |||
118 | 176 | | |
119 | 177 | | |
120 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
121 | 190 | | |
122 | 191 | | |
123 | 192 | | |
| |||
0 commit comments