MVP JS/TS library that catches exceptions and sends to backend
Description
Provide a function to send logs to remote log API.
logger.<level>(<event>, {})
e.g.
logger.info("some_event", {some: "data"})
Additionally catch all exceptions and use logger.error
to log stack trace. Aim to re-raise exception if possible or log to console. The minimum effort should be used to make the stack trace readible (future tickets can improve this).
Can build on pino
to provide majority of functionality, with thin wrapper around.
Acceptance criteria
-
Single setup entrypoint that accepts relative and absolute base url -
Favour using off-the-shelf (Pino) if it fits criteria -
All stack traces are sent to log backend asynchronously as a structured log (i.e. an object) -
On failure to send logs currently we will do nothing - no user message or interruption
-
-
Published to npm
Edited by E. Evstafiev