diff --git a/README.md b/README.md
index 1e8a8c8df9a..a8913a24daf 100644
--- a/README.md
+++ b/README.md
@@ -235,9 +235,9 @@ additional details about how to configure the agent.
| `ECS_NVIDIA_RUNTIME` | nvidia | The Nvidia Runtime to be used to pass Nvidia GPU devices to containers. | nvidia | Not Applicable |
| `ECS_ALTERNATE_CREDENTIAL_PROFILE` | default | An alternate credential role/profile name. | default | default |
| `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` |
-| `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` |
+| `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` |
| `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` |
-| `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` |
+| `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` |
| `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` |
| `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 |
| `ECS_LOG_OPTS` | `{"option":"value"}` | The options for configuring the logging driver set in `ECS_LOG_DRIVER`. | `{}` | Not applicable |
diff --git a/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/logger/log.go b/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/logger/log.go
index 3540f71beda..28b15b5481b 100644
--- a/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/logger/log.go
+++ b/agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/logger/log.go
@@ -39,10 +39,10 @@ const (
DEFAULT_LOGLEVEL = "info"
DEFAULT_LOGLEVEL_WHEN_DRIVER_SET = "off"
- DEFAULT_ROLLOVER_TYPE = "date"
+ DEFAULT_ROLLOVER_TYPE = "size"
DEFAULT_OUTPUT_FORMAT = logFmt
DEFAULT_TIMESTAMP_FORMAT = time.RFC3339
- DEFAULT_MAX_FILE_SIZE float64 = 10
+ DEFAULT_MAX_FILE_SIZE float64 = 1
DEFAULT_MAX_ROLL_COUNT int = 24
DEFAULT_LOGTO_STDOUT = true
)
diff --git a/ecs-agent/logger/log.go b/ecs-agent/logger/log.go
index 3540f71beda..28b15b5481b 100644
--- a/ecs-agent/logger/log.go
+++ b/ecs-agent/logger/log.go
@@ -39,10 +39,10 @@ const (
DEFAULT_LOGLEVEL = "info"
DEFAULT_LOGLEVEL_WHEN_DRIVER_SET = "off"
- DEFAULT_ROLLOVER_TYPE = "date"
+ DEFAULT_ROLLOVER_TYPE = "size"
DEFAULT_OUTPUT_FORMAT = logFmt
DEFAULT_TIMESTAMP_FORMAT = time.RFC3339
- DEFAULT_MAX_FILE_SIZE float64 = 10
+ DEFAULT_MAX_FILE_SIZE float64 = 1
DEFAULT_MAX_ROLL_COUNT int = 24
DEFAULT_LOGTO_STDOUT = true
)
diff --git a/ecs-agent/logger/log_unix_test.go b/ecs-agent/logger/log_unix_test.go
index c670997e5c2..7e879401a32 100644
--- a/ecs-agent/logger/log_unix_test.go
+++ b/ecs-agent/logger/log_unix_test.go
@@ -48,8 +48,8 @@ func TestSeelogConfig_Default(t *testing.T) {
-
+
@@ -125,8 +125,8 @@ func TestSeelogConfig_DebugLevel(t *testing.T) {
-
+
@@ -157,7 +157,7 @@ func TestSeelogConfig_SizeRollover(t *testing.T) {
+ maxsize="1000000" archivetype="none" maxrolls="24" />
@@ -249,8 +249,8 @@ func TestSeelogConfig_JSONOutput(t *testing.T) {
-
+
@@ -277,8 +277,8 @@ func TestSeelogConfig_JSONNoStdout(t *testing.T) {
-
+
@@ -338,8 +338,8 @@ func TestSeelogConfig_NoOnInstanceLog(t *testing.T) {
-
+
@@ -366,8 +366,8 @@ func TestSeelogConfig_DifferentLevels(t *testing.T) {
-
+
@@ -400,8 +400,8 @@ func TestSeelogConfig_FileLevelDefault(t *testing.T) {
-
+
@@ -450,8 +450,8 @@ func TestSetOutputFormat(t *testing.T) {
-
+
@@ -522,6 +522,37 @@ func TestSetLogToStdout(t *testing.T) {
require.Equal(t, `
+
+
+
+
+
+
+
+
+
+`, c)
+}
+
+func TestSeelogConfig_HourlyRollover(t *testing.T) {
+ Config = &logConfig{
+ logfile: "foo.log",
+ driverLevel: DEFAULT_LOGLEVEL,
+ instanceLevel: DEFAULT_LOGLEVEL,
+ RolloverType: "hourly",
+ outputFormat: DEFAULT_OUTPUT_FORMAT,
+ MaxFileSizeMB: DEFAULT_MAX_FILE_SIZE,
+ MaxRollCount: DEFAULT_MAX_ROLL_COUNT,
+ logToStdout: DEFAULT_LOGTO_STDOUT,
+ }
+ c := seelogConfig()
+ require.Equal(t, `
+
+
+
+
+
diff --git a/ecs-agent/logger/log_windows_test.go b/ecs-agent/logger/log_windows_test.go
index 83fd73482b5..1b7a8a062f2 100644
--- a/ecs-agent/logger/log_windows_test.go
+++ b/ecs-agent/logger/log_windows_test.go
@@ -44,8 +44,8 @@ func TestSeelogConfigWindows_Default(t *testing.T) {
-
+
@@ -105,8 +105,8 @@ func TestSeelogConfigWindows_DebugLevel(t *testing.T) {
-
+
@@ -139,7 +139,7 @@ func TestSeelogConfigWindows_SizeRollover(t *testing.T) {
+ maxsize="1000000" archivetype="none" maxrolls="24" />
@@ -237,8 +237,8 @@ func TestSeelogConfigWindows_JSONOutput(t *testing.T) {
-
+
@@ -270,8 +270,8 @@ func TestSeelogConfigWindows_NoOnInstanceLog(t *testing.T) {
-
+
@@ -303,6 +303,39 @@ func TestSeelogConfigWindows_DifferentLevels(t *testing.T) {
+
+
+
+
+
+
+
+
+`, c)
+}
+
+func TestSeelogConfigWindows_HourlyRollover(t *testing.T) {
+ Config = &logConfig{
+ logfile: "foo.log",
+ driverLevel: DEFAULT_LOGLEVEL,
+ instanceLevel: DEFAULT_LOGLEVEL,
+ RolloverType: "hourly",
+ outputFormat: DEFAULT_OUTPUT_FORMAT,
+ MaxFileSizeMB: DEFAULT_MAX_FILE_SIZE,
+ MaxRollCount: DEFAULT_MAX_ROLL_COUNT,
+ logToStdout: DEFAULT_LOGTO_STDOUT,
+ }
+ c := seelogConfig()
+ require.Equal(t, `
+
+
+
+
+
+
+
+
@@ -339,8 +372,8 @@ func TestSeelogConfigWindows_FileLevelDefault(t *testing.T) {
-
+