+function run () {
+ return new Promise(async res => {
+ const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR)
+ const lastLogFile = await getNewestFile(logFiles, CONFIG.STORAGE.LOG_DIR)
+
+ const path = join(CONFIG.STORAGE.LOG_DIR, lastLogFile)
+ console.log('Opening %s.', path)
+
+ const stream = createReadStream(path)
+
+ const rl = createInterface({
+ input: stream
+ })
+
+ rl.on('line', line => {
+ const log = JSON.parse(line)
+ // Don't know why but loggerFormat does not remove splat key
+ Object.assign(log, { splat: undefined })