Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Amazon CloudWatch Logs support a newline character?

We are aggregating our logs to Amazon CloudWatch Logs.

We'd like to be able to append a stack trace. Does CloudWatch Log's web interface parse a newline character to make this more readable?

like image 348
Miriam H. Avatar asked Mar 24 '17 21:03

Miriam H.


1 Answers

I have faced a similar problem with logs for Lambda and I found two answers on the web that can be useful for anyone dealing with this.

1) For CloudWatch Logs Agent you could configure the multi_line_start_pattern parameter (pointed by Greg here).

2) On Lambda Logs you could use \r instead of \n as the new line delimeter (tested on 2017-05-30 only for lambda running python 2.7 with logging module)(pointed by RichardBronosky here).

like image 173
pipelog Avatar answered Nov 11 '22 00:11

pipelog