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

Keep same file name and archive files with timeStamp #44

Closed
rotosonic opened this issue Aug 27, 2018 · 5 comments
Closed

Keep same file name and archive files with timeStamp #44

rotosonic opened this issue Aug 27, 2018 · 5 comments

Comments

@rotosonic
Copy link

Is it possible to keep logging to a file with the same name and add a timeformat to archive files

@rogerc
Copy link
Owner

rogerc commented Sep 1, 2018

Hi @rotosonic,

The reason I didn't go down that route was to reduce the amount of work required when doing rotation and avoid issues moving/renaming files when doing the rotation.

An alternative to this would be creating a symbolic link to the current file being written to with the option to specify what that name should be so if you wanted to see what the current file being written was you would just go to the filename specified when initialising the stream. Would that work?

Roger

@rogerc
Copy link
Owner

rogerc commented Sep 1, 2018

After some testing, if a link already exists it won't overwrite it so I'd need to unlink the 'file' if it cannot complete the symbolic link creation. I'll run some benchmarks to see how much of an issue that is.

@LiangNex
Copy link

LiangNex commented Mar 15, 2019

Hi @rogerc ,

Do we have any update on this issue?

Thanks
Liang

@bellostom
Copy link

Any news on this one?
I ended up here from
winstonjs/winston-daily-rotate-file#23
which is already mentioned above, as currently frequent log rotations, makes tracking the latest log file difficult

@rogerc
Copy link
Owner

rogerc commented Sep 1, 2019

v0.5.0 will add a symbolic link to the current log file which you can access via current.log

@rogerc rogerc closed this as completed in ab74972 Sep 1, 2019
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

4 participants