@ilb/clientlogger

1.0.8 • Public • Published

Client logger

Отправка ошибок клиента на почту

Install

npm i @ilb/clientlogger

Usage

Env

  • SERVER_ADMIN - mail where the letter will be sent
  • MAIL_URL - smpt url
  • LOG_PATH - url to which the error will be sent ('/service/log' by default)

Client

import { logger } from '@ilb/clientlogger';

window.onerror = (msg, url, line) => {
  logger.error({ msg, url, line, link: location.href });
}

Server

import nc from 'next-connect';
import sendLog from "@ilb/clientlogger/src/sendLog";

export default nc().post(sendLog);

Readme

Keywords

none

Package Sidebar

Install

npm i @ilb/clientlogger

Weekly Downloads

9

Version

1.0.8

License

MIT

Unpacked Size

2.31 kB

Total Files

5

Last publish

Collaborators

  • barakok
  • dmitryi698
  • ssortia
  • unsfer
  • slavb18
  • maximumquiet