Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log file can't rotate #4

Open
superhjw opened this issue Aug 22, 2018 · 0 comments
Open

log file can't rotate #4

superhjw opened this issue Aug 22, 2018 · 0 comments

Comments

@superhjw
Copy link

found that the log file can't roate to another file, ex: system.log, when maxsize will not to change to system.log.1.
code:
lvl := log4go.INFO
switch CFG.UString("log.level", "INFO") {
case "DEBUG":
lvl = log4go.DEBUG
case "INFO":
lvl = log4go.INFO
case "WARNING":
lvl = log4go.WARNING
case "ERROR":
lvl = log4go.ERROR
case "CRITICAL":
lvl = log4go.CRITICAL
default:
lvl = log4go.INFO
}
LOG.AddFilter("stdout", lvl, log4go.NewConsoleLogWriter())
logWriter := log4go.NewFileLogWriter("system.log", true, true)
logWriter.SetRotateSize(10)
logWriter.SetRotateLines(1000)
LOG.AddFilter("log", lvl, logWriter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant