winstonjs / winston

A logger for just about everything.
http://github.com/winstonjs/winston
MIT License
22.85k stars 1.81k forks source link

Pagination only works in ASC mode for File Transport #1241

Open spearmootz opened 6 years ago

spearmootz commented 6 years ago

Because winston reads the file from the first line to the last. if you offset with the start property what will happen is it will read the first few lines until it reaches the start point and then it will insert records into the array.

but since the array only cares about the last ones it will always end up with the same result. if the option.start is close to the log length then you will only end up with a subset of the first result. and therefore cannot paginate

Here are my queries

   rows: 100,
   start: 100,
   from: moment("1918-03-17T11:31:08.505"),
   until: moment("2018-03-18T11:31:08.505"),
 }
{ 
  rows: 100,
  start: 0,
  from: moment("1918-03-17T11:31:08.505"),
  until: moment("2018-03-18T11:31:08.505")
}
spearmootz commented 6 years ago

i mean to use it for a winston gui

https://github.com/spearmootz/winston-dashboard

jacargentina commented 4 years ago

@spearmootz If you still interested, maybe can give a test on my PR ? Cheers!