standard-log-remote
v12.1.2
Published
remote logging for `standard-log`
Downloads
6
Readme
standard-log-remote
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:
- Encrypt the message using
formatter
. - Do not persist these logs or store them with strict space control
- Treat them as direct inputs, do not trust any message saved.
- Should not return these logs back to the user.
- 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.