File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lambda-extensions/sumoclient Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ func (s *sumoLogicClient) getLogStream() string {
257
257
258
258
func (s * sumoLogicClient ) enhanceLogs (msg responseBody ) {
259
259
s .logger .Debugln ("Enhancing logs" )
260
- for _ , item := range msg {
260
+ for idx , item := range msg {
261
261
// item["FunctionName"] = s.config.FunctionName
262
262
// item["FunctionVersion"] = s.config.FunctionVersion
263
263
// creating loggroup/logstream as they are not available in Env.
@@ -277,12 +277,18 @@ func (s *sumoLogicClient) enhanceLogs(msg responseBody) {
277
277
message = strings .TrimSpace (message )
278
278
json , err := utils .ParseJson (message )
279
279
if err != nil {
280
- item ["message" ] = message
280
+ if s .config .EnhanceJsonLogs {
281
+ item ["message" ] = message
282
+ } else {
283
+ s .logger .Debug ("EnhanceJsonLogs disabled sending only message." )
284
+ msg [idx ] = map [string ]interface {}{"message" : message }
285
+ }
281
286
} else {
282
287
if s .config .EnhanceJsonLogs {
283
288
item ["message" ] = json
284
289
} else {
285
- item = json
290
+ s .logger .Debug ("EnhanceJsonLogs disabled sending only json log." )
291
+ msg [idx ] = json
286
292
}
287
293
}
288
294
} else if ok && logType == "platform.report" {
You can’t perform that action at this time.
0 commit comments