smartcontractkit / external-adapters-js

Monorepo containing JavaScript implementation of external adapters
MIT License
270 stars 303 forks source link

Change adapter logs to use a human readable timestamp #1881

Closed justinkaseman closed 2 years ago

justinkaseman commented 2 years ago

Description

Our adapter logs currently show a timestamp that is in UTC milliseconds (milliseconds elapsed since January 1, 1970 00:00:00 UTC)

{
    "level": "info",
    "time": 1652986344722,
    "pid": 29,
    "hostname": "d3fd61d317",
    "reason": "...",
    "instanceId": "324218e8-29c9-4f52-aed7",
    "msg": "[warmupReducer] Deleting subscription. "
}

This is an ask from node operators to aid in EA issue debugging.

These timestamps should be shown in a human friendly format such as with Date.toISOString()

Since logging is handled by Pino, a formatter will need to be added within its setup in packages/core/bootstrap/src/lib/modules/logger.ts. See this github issue as an example.

alejoberardino commented 2 years ago

This should only be enabled with DEBUG=true imo, parsing the date can add up if we're logging a lot