You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change ECS Agent log rollover defaults to size-based rotation
- Change DEFAULT_ROLLOVER_TYPE from 'date' to 'size'
- Change DEFAULT_MAX_FILE_SIZE from 10MB to 1MB
- Update README.md documentation for ECS_LOG_ROLLOVER_TYPE and ECS_LOG_MAX_FILE_SIZE_MB
- Fix unit tests to expect size-based rollover instead of date-based
- Add test cases for explicit hourly rollover to maintain backward compatibility
This provides more predictable log file sizes while allowing users to
override the behavior through environment variables if needed.
|`ECS_ENABLE_SPOT_INSTANCE_DRAINING`|`true`| Whether to enable Spot Instance draining for the container instance. If true, if the container instance receives a [spot interruption notice](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html), agent will set the instance's status to [DRAINING](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html), which gracefully shuts down and replaces all tasks running on the instance that are part of a service. It is recommended that this be set to `true` when using spot instances. |`false`|`false`|
238
-
|`ECS_LOG_ROLLOVER_TYPE`|`size`|`hourly`| Determines whether the container agent logfile will be rotated based on size or hourly. By default, the agent logfile is rotated each hour. |`hourly`|`hourly`|
238
+
|`ECS_LOG_ROLLOVER_TYPE`|`size`|`hourly`| Determines whether the container agent logfile will be rotated based on size or hourly. By default, the agent logfile is rotated based on size. |`size`|`size`|
239
239
|`ECS_LOG_OUTPUT_FORMAT`|`logfmt`|`json`| Determines the log output format. When the json format is used, each line in the log would be a structured JSON map. |`logfmt`|`logfmt`|
240
-
|`ECS_LOG_MAX_FILE_SIZE_MB`|`10`| When the ECS_LOG_ROLLOVER_TYPE variable is set to size, this variable determines the maximum size (in MB) the log file before it is rotated. If the rollover type is set to hourly then this variable is ignored. |`10`|`10`|
240
+
|`ECS_LOG_MAX_FILE_SIZE_MB`|`1`| When the ECS_LOG_ROLLOVER_TYPE variable is set to size, this variable determines the maximum size (in MB) the log file before it is rotated. If the rollover type is set to hourly then this variable is ignored. |`1`|`1`|
241
241
|`ECS_LOG_MAX_ROLL_COUNT`|`24`| Determines the number of rotated log files to keep. Older log files are deleted once this limit is reached. |`24`|`24`|
242
242
|`ECS_LOG_DRIVER`|`awslogs`|`fluentd`|`gelf`|`json-file`|`journald`|`logentries`|`syslog`|`splunk`| The logging driver to be used by the Agent container. |`json-file`| Not applicable |
243
243
|`ECS_LOG_OPTS`|`{"option":"value"}`| The options for configuring the logging driver set in `ECS_LOG_DRIVER`. |`{}`| Not applicable |
0 commit comments