英文:
Seelog rollingfile filename pattern not as expected
问题
我有一个类似以下的seelog配置文件:
<seelog minlevel="info">
<outputs>
<console />
<rollingfile type="date" datepattern="060201" filename="/tmp/-myApp.log" maxrolls="5" archivetype="none"/>
</outputs>
</seelog>
生成的文件名是类似于/tmp/-myApp.log.142711
,但我期望的是/tmp/142711-myApp.log
,因为在https://github.com/cihub/seelog/wiki/Receiver-reference中建议的方式是:
- 对于'date'滚动方式,文件名将按照以下方式形成:
time.Now().Format(rollfileWriter.datePattern)+" "+rollFileWriter.fileName)
是否有办法实现我期望的行为?我是否思考得不对?
英文:
I have a seelog config file like
<seelog minlevel="info">
<outputs>
<console />
<rollingfile type="date" datepattern="060201" filename="/tmp/-myApp.log" maxrolls="5" archivetype="none"/>
</outputs>
</seelog>
What comes out are files like /tmp/-myApp.log.142711, I expected /tmp/142711-myApp.log as it is suggested at https://github.com/cihub/seelog/wiki/Receiver-reference qoute:
* In case of 'date' rolling, the file names will be formed this way:
time.Now().Format(rollfileWriter.datePattern)+" "+rollFileWriter.fileName)
Can my expected behaviour be achieved somehow? Am I thinking in the wrong way?
答案1
得分: 0
根据 https://github.com/cihub/seelog/issues/71 中开发者的说法,这种意外行为是由于过时的文档所导致的,并且可能在将来得到解决。目前还没有可用的“修复”来实现所需的行为。
英文:
As a developer states in https://github.com/cihub/seelog/issues/71 this unexpected behaviour results from a outdated documentation and may be addressed in the future. A "fix" to get the desired behaviour is not yet available.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论