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

Daily rotator transport doesn't seem to respect tailable #23

Closed
mattberther opened this issue Mar 10, 2016 · 13 comments
Closed

Daily rotator transport doesn't seem to respect tailable #23

mattberther opened this issue Mar 10, 2016 · 13 comments

Comments

@mattberther
Copy link
Member

Originally reported by @alonisser at winstonjs/winston#589

The docs state that : "In addition to the options accepted by the File transport..." So I assumed it would respect tailable (meaning it would always log to the same file, and rotate with date the older/maxsized files). But I succeed in making it work (or locating in daily rotator transport code exactly where would it actually respect tailable.

Is there a way to make this work?

@rootical
Copy link

Any news on that? Can't make it working :(

@WegDamit
Copy link

Ping.

It would be nice to have only one file to tail, like bla.log and have its content rotated to bla-yy.mm.dd.log (or whatever)
Now the used log file is already named bla-.log.
Makes it harder to ind the actual log fail for e.g. monitoring...

@AlexGue
Copy link

AlexGue commented Mar 7, 2018

Any updates about this?

When I set (maxFiles: '3d') for example, and set maxSize option, it creates files a new file without deleting old ones every time the maxSize is reached.

I want to add the date to log filenames and take care about max number of files, to limit the total size of all log files together, but I didn't make it work.

@mattberther
Copy link
Member Author

@AlexGue which version of the transport are you using? If you're using the 2.x RC, please continue the conversation over at #107.

@cronon
Copy link

cronon commented Apr 9, 2018

still doesn't work with winston@2.4.1 and winston-daily-rotate-file@3.0.1
I tried following config

const logger = new winston.Logger({
    transports: [
      new winston.transports.DailyRotateFile({
        filename: 'drf.log',
        datePattern: 'HH-mm',
        maxFiles: 3,
        maxSize: 200,
        tailable: true
      })
    ]
})

and saw files i.e. drf.log.16-42 drf.log.16-42.1 drf.log.16-42.2 where drf.log.16-42 contains the oldest logs

@mattberther
Copy link
Member Author

This issue is still open, meaning tailable support does not currently work with this transport.

@FelixButzbach
Copy link

This would be really great to have. Any plans on looking into? Or is this something that needs to be done in the winston package?

@mattberther
Copy link
Member Author

This is documented as an issue upstream at rogerc/file-stream-rotator#44. I'll continue to monitor there and incorporate a new version that has this support, once available.

@rogerc
Copy link

rogerc commented Sep 1, 2019

@mattberther I've just published 0.5.0 with some enhancements/fixes. One of them is to include a symbolic link to the current active log file that can be accessed via current.log The current.log file is in the same directory as the other logs.

@mattberther
Copy link
Member Author

090f7a9 introduced file-stream-rotator@0.5, which adds a symlink to current.log which can be tailed.

There are a few other bug fixes to resolve before I push winston-daily-rotate-file@4.0.0 to npm. I expect this to happen in the next day or two.

@sumeet-bansal
Copy link

sumeet-bansal commented Sep 6, 2019

@rogerc Is there any way to rename current.log to something else, e.g. service.log? I'd like to be able to send different logs to different files so I end up with service.log.DATE, request.log.DATE, and current.log which only links to one of the two.

@rogerc
Copy link

rogerc commented Sep 9, 2019

@sumeet-bansal v.0.5.5 has the option to configure the name of the symbolic link. @mattberther also submitted a PR to enable symlink to not make it mandatory. Not sure if @mattberther needs to do anything to enable the winston transport with v0.5.5

@mattberther
Copy link
Member Author

@sumeet-bansal Resolved with 31b1dc5 and pushed as winston-daily-rotate-file@4.1.0.

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

No branches or pull requests

8 participants