Seelog滚动文件的文件名模式与预期不符。

huangapple go评论89阅读模式
英文:

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

&lt;seelog minlevel=&quot;info&quot;&gt;
    &lt;outputs&gt;
        &lt;console /&gt;
        &lt;rollingfile type=&quot;date&quot; datepattern=&quot;060201&quot; filename=&quot;/tmp/-myApp.log&quot; maxrolls=&quot;5&quot; archivetype=&quot;none&quot;/&gt;
    &lt;/outputs&gt;
&lt;/seelog&gt;

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 &#39;date&#39; rolling, the file names will be formed this way:
   time.Now().Format(rollfileWriter.datePattern)+&quot; &quot;+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.

huangapple
  • 本文由 发表于 2014年11月28日 06:09:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/27179315.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定