diff --git a/pkg/executor/executor.go b/pkg/executor/executor.go index a9723578..e62b7b81 100644 --- a/pkg/executor/executor.go +++ b/pkg/executor/executor.go @@ -113,17 +113,19 @@ func (pj *proxyJSONLogger) Write(p []byte) (int, error) { logLine := string(logLineRaw) + logEntry := pj.WithField(app.ProxyJsonLogKey, true) + if len(logLine) > 10000 { logLine = fmt.Sprintf("%s:truncated", string(logLine[:10000])) - } - truncetedLog, _ := json.Marshal(map[string]string{ - "truncated": logLine, - }) + truncatedLog, _ := json.Marshal(map[string]string{ + "truncated": logLine, + }) - logEntry := pj.WithField(app.ProxyJsonLogKey, true) + logEntry.Log(log.FatalLevel, string(truncatedLog)) + } - logEntry.Log(log.FatalLevel, string(truncetedLog)) + logEntry.Log(log.FatalLevel, string(logLine)) return len(p), nil }