I have a Web Api (.Net Core 3.0), running on AWS Cluster (ECS), with EC2 instances. In task definition I've configured awslog driver in container to write logs to a certain log group / region.
I'm having problems related to multiline log messages emitted by my Web API (every single line appears splittend in diferrent log messages in CloudWatch). Researching, I've found information that seems to be related to this matter, but I´m not sure about some points.
I've found some information regarding CloudWatch Agent that seems to be related with multiline configuration. Is CloudWatch Agent related with log messages being emitted by my containerized Web API? I mean, my Web API emits log to console and they are automatically thrown to CloudWatch Logs via awslog driver. So, I don't know if Agent in doing anything in this scenario.
The point, is that in CloudWatch Agent documentation, I read something related to a configuration file that seems to be related with the multiline issue:
“multi_line_start_pattern: Specifies the pattern for identifying the start of a log message”
I don't know how the Agent is related to the awslog driver. Regarding to the awslog driver I found these properties related to multiline matter that I could include in my task definition:
“awslogs-multiline-pattern: this option defines a multiline start pattern using a regular expression”
“awslogs-datetime-format: this option defines a multiline start pattern in Python strftime format”
So, both, CloudWatch Agent and awslog driver configuration could resolve the multiline issue? They are related? They are intended for different scopes?
Thanks in advance.