Skip to content

Conversation

@ofiliz
Copy link
Contributor

@ofiliz ofiliz commented Jun 13, 2017

Rotates log files when they reach the size limit, keeps the last n files.

Copy link
Contributor

@sharmasushant sharmasushant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should append timestamps to filenames when we start writing to the log file. When the file count goes beyond the limit, we should delete the file with oldest time stamp.

log/logger.go Outdated
const (
logPrefix = ""
logFileExtension = ".log"
maxLogFileSize = 10 * 1024 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxLogFileSizeInBytes

logFileExtension = ".log"
maxLogFileSize = 10 * 1024 * 1024
maxLogFileCount = 8
rotationCheckFrq = 8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add units here too, rotationCheckFreqInCalls

const logFilePerm = os.FileMode(0664)

const syslogTag = "AzureContainerNet"
const syslogTag = "azure-vnet-plugin"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the old name was better because CNS is not a vnet-plugin.

Copy link
Contributor

@sharmasushant sharmasushant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants