Skip to content

jitesoft/yolog-file-plugin

Repository files navigation

Yolog File Plugin

npm (scoped) Known Vulnerabilities pipeline status coverage report npm Back project

Plugin for the @jitesoft/yolog logger to write to files.

Due to the filesystem requirement a FS module is needed, this is not available in the browser, so this plugin is not suitable in the browser!

If you wish to log json strings in common json log format to file, be sure to check out the yolog json plugin!

Usage:

Install with your favorite package manager!

npm i @jitesoft/yolog-file-plugin --save
yarn add @jitesoft/yolog-file-plugin

Import and use just as with any other yolog plugin!

import logger from '@jitesoft/yolog';
import FilePlugin from '@jitesoft/yolog-file-plugin';
logger.addPlugin(new FilePlugin('path/to/log/dir', 'debug.log'));