Closed
Description
When logging out a number of messages, when doing a query ordering by desc, will return the oldest messages then order them by time.
var fileLogger = new FileLoggerAdapter();
for (var i = 0; i < 10; i ++) {
fileLogger.info(i);
}
// Wait for the logs to flush before querying
setTimeout(function() {
fileLogger.query({size:2, order: 'desc'})
.then((res)=> {
console.log(res)
});
}, 100);
In this output res
will be
[ { level: 'info',
message: '1',
timestamp: '2016-04-20T07:12:53.376Z' },
{ level: 'info',
message: '0',
timestamp: '2016-04-20T07:12:53.375Z' } ]
Its not until the size is expanded to all of the log messages that it gets them all in the right order.
Ideally this should return
[ { level: 'info',
message: '9',
timestamp: '2016-04-20T07:12:53.377Z' },
{ level: 'info',
message: '8',
timestamp: '2016-04-20T07:12:53.377Z' } ]
Metadata
Metadata
Assignees
Labels
No labels