Open hamshiva opened 9 years ago
I missed this part of the patch:
@@ -333,7 +334,7 @@ func (o *FileOutput) committer(or OutputRunner, errChan chan error) {
}
case rotateTime := <-o.rotateChan:
o.file.Close()
- o.path = rotateTime.Format(o.Path)
+ o.path = strftime.Format(o.Path, rotateTime)
if err = o.openFile(); err != nil {
Hi,
I ran into an issue using File Output and rotation. Let take the following example config:
This will result in a file named corretly but the directory apache2 will be rename apache(dayofmonth) Using Go time Format, there is no way to avoid apache2 to become something else... And this will append to anythin that match a part of the Go datetime reference (Mon Jan 2 15:04:05 -0700 MST 2006)...
It seems that there is no way in Go to escape literals in the time Format layout. The only way I found was patch Heka to use strftime syntax provided by an external light weigth module https://github.com/jehiah/go-strftime
There is a git diff of my patch:
Best regards,