Description
I noticed that if I delete all of the log streams in my ECS service's log group, then ECS stops logging until I kill/restart the service. This is an unexpected behavior compared to other AWS services that will create a new log stream and continue logging when log streams are deleted.
I believe the solution is to catch the error when it happens, and if the error is ResourceNotFoundException on the log stream, then recreate the stream (or create a new one) and submit the batch again.
I think the relevant code is at
|
resp, err := l.client.PutLogEvents(context.TODO(), input) |
This would be a nice quality of life improvement for those of us who are testing code running in ECS.
Description
I noticed that if I delete all of the log streams in my ECS service's log group, then ECS stops logging until I kill/restart the service. This is an unexpected behavior compared to other AWS services that will create a new log stream and continue logging when log streams are deleted.
I believe the solution is to catch the error when it happens, and if the error is ResourceNotFoundException on the log stream, then recreate the stream (or create a new one) and submit the batch again.
I think the relevant code is at
moby/daemon/logger/awslogs/cloudwatchlogs.go
Line 709 in 258ee34
This would be a nice quality of life improvement for those of us who are testing code running in ECS.