-
Notifications
You must be signed in to change notification settings - Fork 876
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
[question] How do I create dynamic customized logfile names? #1917
Comments
I recommend utilizing your system tools to do this https://getpino.io/#/docs/help?id=rotate |
check out the pino-roll module. |
Hey guys, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
I'm new to pino so sorry if my question is very basic.
I'm trying to use a custom transport to log to a file with this format:
application-<year>-<month>-<date>.log
I want it to switch files when the day ends / transfers.
Currently I have this in my custom transport:
My logger:
This works for the first file but not for subsequent dates.
I understand this is because the custom transport is only called once on initialization and not each time the write functionality is called.
I've been scouring the net for examples for my use case to no avail. Help would be much appreciated.
The text was updated successfully, but these errors were encountered: