Skip to content

Commit 2d2404a

Browse files
committed
Ensure log lines are only terminated with a single line feed
1 parent d17f536 commit 2d2404a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/logrotation/logrotation.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ func (r *RotatingLogger) Append(messageLine string, deduplicateLine bool) {
7676
r.lock.Lock()
7777
defer r.lock.Unlock()
7878

79+
// Ensure message is terminated with a single line feed
80+
messageLine = strings.TrimSpace(messageLine) + "\n"
81+
7982
// we will always log in the first instance of the log files
8083
logFilePath := r.instanceFileName(1)
8184

0 commit comments

Comments
 (0)