Skip to content

Commit 2c477dc

Browse files
authored
Kelvin lal/log troubleshooting link (#44704)
### What does this PR do? Adding a doc link for file permission errors when configuring tailing log files https://docs.datadoghq.com/agent/logs/?tab=tailfiles#custom-log-collection Key troubleshooting step set https://docs.datadoghq.com/logs/guide/log-collection-troubleshooting-guide/?tab=linux#permission-issues-tailing-log-files ### Motivation Better Agent Error messages project Increased doc visibility for customers to troubleshoot ### Describe how you validated your changes Tested locally with a DDA build of the Agent, by changing permissions to tailing log file ### Additional Notes <img width="1024" height="252" alt="image" src="https://github.com/user-attachments/assets/11cd6cbe-ab1b-4f70-bea0-8d16691d8ced" /> Co-authored-by: kelvin.lal <kelvin.lal@datadoghq.com>
1 parent af2fe9f commit 2c477dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/logs/status/utils/status.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package utils
77

88
import (
99
"fmt"
10+
"strings"
1011
"sync"
1112
)
1213

@@ -46,7 +47,12 @@ func (s *LogStatus) Error(err error) {
4647
s.mu.Lock()
4748
defer s.mu.Unlock()
4849
s.status = isError
49-
s.err = "Error: " + err.Error()
50+
if strings.Contains(err.Error(), "permission denied") {
51+
s.err = "Error: " + err.Error() +
52+
". See https://docs.datadoghq.com/logs/guide/log-collection-troubleshooting-guide/?tab=linux#permission-issues-tailing-log-files for details on how to troubleshoot this issue"
53+
} else {
54+
s.err = "Error: " + err.Error()
55+
}
5056
}
5157

5258
// IsPending returns whether the current status is not yet determined.

0 commit comments

Comments
 (0)