pinojs / pino-elasticsearch

🌲 load pino logs into Elasticsearch
MIT License
179 stars 67 forks source link

Constructor breaks when an empty log input is received (Date #19

Open buendiadas opened 6 years ago

buendiadas commented 6 years ago

On pino-elasticsearch:L27

If value equals {}

    } else {
      value.time = (new Date(value.time)).toISOString()
    }

It will return:

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)

And break

mcollina commented 6 years ago

Thanks for reporting this! Would you like to send a PR?