@indexzero and @FotoVerite and @Marak Squires
i hve maxFile :10 ,so it create 10 files(1,2,3,4,5,6,7,8,9,10) and after 10 in replace 1 as 11 and so on it goes ,upto this ok.
i have run my server again it star from 1 to 10, already present log file number was (20 to 30 ) rotation reach 20 i will start from 31 ,32
what happens my new 10 files(11 to 20) ,why it kept 20 to 30 from the last server run ?
Hi @mohamedmohsin,
First of all, thanks for reporting. Do you think you can share a snippet showing this behavior?
Thanks in advance,
Hi, Winston is great! But I've seen some odd behaviour with the logger.transports.File transport too.
I did some testing with maxFiles=5 and a small maxFileSize so I could trigger rotation easily. This is what I saw.
Start up app.
Restart app (at this point, foo3.log - foo7.log exist)
Restart app (at this point, foo2.log and foo6.log - foo10.log exist)
I've highlighted what I think are problems in bold - deleting newer instead of older logs, keeping more logs than maxFiles, mixing older and newer logs.
As a general approach, could Winston's file transport mimic the log rotation behaviour that linux logrotate uses? I.e.:
I think it would be simpler for people to understand this behaviour.
any update about log rotation of winston ?
I've got the same issue still in End 2016. We have a long term running app with logs > 100... After restart we got at doubled log files in count. I'd appreciate any change here to mimic linux logrotation as mentioned before!
+1
-rw-r--r-- 1 1049089 5245600 Nov 22 13:17 guiserver2.log
-rw-r--r-- 1 1049089 5245680 Nov 22 13:18 guiserver3.log
-rw-r--r-- 1 1049089 5245326 Nov 22 13:18 guiserver4.log
-rw-r--r-- 1 1049089 5245680 Nov 22 13:18 guiserver5.log
-rw-r--r-- 1 1049089 1169872 Nov 22 13:18 guiserver6.log
-rw-r--r-- 1 1049089 5245502 Nov 22 13:16 guiserver48.log
-rw-r--r-- 1 1049089 5244624 Nov 22 13:17 guiserver49.log
-rw-r--r-- 1 1049089 5244622 Nov 22 13:17 guiserver50.log
-rw-r--r-- 1 1049089 5245856 Nov 22 13:17 guiserver51.log
-rw-r--r-- 1 1049089 2164448 Nov 22 13:17 guiserver52.log
What's the status on this four years later? I'm seeing the same issues and I'm losing log entries because of it. I have an app that starts up once a day, logs a bunch of data, then shuts down. I have maxFiles set to 30 and it's only using 5 or 6 of them per run. By the end of the run I'm missing log entries from the beginning.
Use logrotate
https://linux.die.net/man/8/logrotate
On Fri, Aug 24, 2018 at 4:17 PM David Land notifications@github.com wrote:
What's the status on this four years later? I'm seeing the same issues and
I'm losing log entries because of it. I have an app that starts up once a
day, logs a bunch of data, then shuts down. I have maxFiles set to 30 and
it's only using 5 or 6 of them per run. By the end of the run I'm missing
log entries from the beginning.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/winstonjs/winston/issues/477#issuecomment-415871049,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAERe2xpSbl03mhLputRMnkkeeJHvn2uks5uUF9DgaJpZM4CxIxb
.
I ended up using this transport. Pretty easy to use and seems to work well.
Yes, the daily file rotate transport is recommended. Logrotate works too but it’s nice to stay within the Winston ecosystem :)
Going to close this, but if anyone has reproducible issues with the File transport, feel free to open a fresh issue. Thanks!
Most helpful comment
Hi, Winston is great! But I've seen some odd behaviour with the
logger.transports.Filetransport too.I did some testing with maxFiles=5 and a small maxFileSize so I could trigger rotation easily. This is what I saw.
Start up app.
Restart app (at this point, foo3.log - foo7.log exist)
Restart app (at this point, foo2.log and foo6.log - foo10.log exist)
I've highlighted what I think are problems in bold - deleting newer instead of older logs, keeping more logs than maxFiles, mixing older and newer logs.
As a general approach, could Winston's file transport mimic the log rotation behaviour that linux logrotate uses? I.e.:
I think it would be simpler for people to understand this behaviour.