From 9501cebd5e2738915112b42a282dd800396c011a Mon Sep 17 00:00:00 2001 From: Arsenii Kozlov Date: Fri, 27 Jan 2023 09:30:54 +0600 Subject: [PATCH] fix: the same timestamp logs are reverse sorted --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9dbce65..5e2590a 100644 --- a/index.js +++ b/index.js @@ -118,7 +118,7 @@ WinstonCloudWatch.prototype.submit = function(callback) { this.cloudwatchlogs, groupName, streamName, - this.logEvents.sort((a, b) => (a.timestamp > b.timestamp) ? 1 : -1), // sort events into chronological order https://github.com/lazywithclass/winston-cloudwatch/issues/197 + this.logEvents.sort((a, b) => a.timestamp - b.timestamp), // sort events into chronological order https://github.com/lazywithclass/winston-cloudwatch/issues/197 retentionInDays, this.options, callback