standard-log-remote
TypeScript icon, indicating that this package has built-in type declarations

12.1.2 • Public • Published

standard-log-remote

NPM version NPM downloads

Codecov

Visual Studio Code

Sending logs to remote service for standard-log.

Install

npm i standard-log-remote
yarn add standard-log-remote
pnpm add standard-log-remote
rust add standard-log-remote

Usage

import { createStandardLog } from 'standard-log'
import { createRemoteLogReporter } form 'standard-log-remote'

const standardLog = createStandardLog({
  reporters: [createRemoteLogReporter({ url: '...', requestInit: {...} })]
})

const log = standardLog.getLogger('my logger')
log.info('to the remote service!')

Security

Note that logs sent from browser can be intercept an potentially be modified through man-in-the-middle. To mitigate the risk, you can:

  1. Encrypt the message using formatter.
  2. Do not persist these logs or store them with strict space control
  3. Treat them as direct inputs, do not trust any message saved.
  4. Should not return these logs back to the user.
  5. Define convension and strict control of the format of the logs

The raw logs collected should be treated differently then those generated on the server. They should not be returned to the user in the form of log reports, or else your application is subject to Log Injection/Forging and related attacks.

Readme

Keywords

none

Package Sidebar

Install

npm i standard-log-remote

Weekly Downloads

0

Version

12.1.2

License

MIT

Unpacked Size

15.4 kB

Total Files

32

Last publish

Collaborators

  • unional