https://github.com/jitesoft/yolog-file-plugin
File plugin for @jitesoft/yolog.
https://github.com/jitesoft/yolog-file-plugin
file file-logging hacktoberfest javascript jitesoft logging yolog
Last synced: 10 months ago
JSON representation
File plugin for @jitesoft/yolog.
- Host: GitHub
- URL: https://github.com/jitesoft/yolog-file-plugin
- Owner: jitesoft
- License: mit
- Created: 2019-11-03T14:54:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T16:09:33.000Z (about 2 years ago)
- Last Synced: 2025-02-23T04:45:12.167Z (over 1 year ago)
- Topics: file, file-logging, hacktoberfest, javascript, jitesoft, logging, yolog
- Language: JavaScript
- Homepage:
- Size: 1.92 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Yolog File Plugin
[](https://www.npmjs.com/package/@jitesoft/yolog-file-plugin)
[](https://dev.snyk.io/test/npm/@jitesoft/yolog-file-plugin)
[](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/file/commits/master)
[](https://gitlab.com/jitesoft/open-source/javascript/yolog-plugins/file/commits/master)
[](https://www.npmjs.com/package/@jitesoft/yolog-file-plugin)
[](https://opencollective.com/jitesoft-open-source)
Plugin for the [`@jitesoft/yolog`](https://www.npmjs.com/package/@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](https://github.com/jitesoft/yolog-json-plugin)!
Usage:
Install with your favorite package manager!
```bash
npm i @jitesoft/yolog-file-plugin --save
yarn add @jitesoft/yolog-file-plugin
```
Import and use just as with any other yolog plugin!
```js
import logger from '@jitesoft/yolog';
import FilePlugin from '@jitesoft/yolog-file-plugin';
logger.addPlugin(new FilePlugin('path/to/log/dir', 'debug.log'));
```