// Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//	http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

package logger

func loggerConfig() string {
	config := `
	<seelog type="asyncloop" minlevel="` + level + `">
		<outputs formatid="main">
			<console />`
	if logfile != "" {
		config += `<rollingfile filename="` + logfile + `" type="date"
			 datepattern="2006-01-02-15" archivetype="zip" maxrolls="5" />`
	}
	config += `
		</outputs>
		<formats>
			<format id="main" format="%UTCDate(2006-01-02T15:04:05Z07:00) [%LEVEL] %Msg%n" />
		</formats>
	</seelog>
`
	return config
}

// Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//	http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

package logger

func loggerConfig() string {
	config := `
	<seelog type="asyncloop" minlevel="` + level + `">
		<outputs formatid="main">
			<console />`
	if logfile != "" {
		config += `<rollingfile filename="` + logfile + `" type="date"
			 datepattern="2006-01-02-15" archivetype="none" maxrolls="24" />`
	}
	config += `
		</outputs>
		<formats>
			<format id="main" format="%UTCDate(2006-01-02T15:04:05Z07:00) [%LEVEL] %Msg%n" />
		</formats>
	</seelog>
`
	return config
}

Change log archive to none
Change log archive to none

Logs should be retained for 24 hours and deleted. Previous retention
setting of "zip" unintentionally retained logs in a zip file internal to
the container, causing increased CPU load, memory, and disk usage
related to hourly rotation.
