https://github.com/vanioinformatika/node-express-logger
https://github.com/vanioinformatika/node-express-logger
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vanioinformatika/node-express-logger
- Owner: vanioinformatika
- Created: 2017-05-10T09:31:58.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-30T19:43:02.000Z (almost 3 years ago)
- Last Synced: 2025-05-29T16:11:58.829Z (4 months ago)
- Language: TypeScript
- Size: 343 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express console and fluentd logger
[](https://travis-ci.org/vanioinformatika/node-express-logger)
Logger is configured to log messages to the console and [fluentd](http://www.fluentd.org/).
When creating new logger instance need to pass **logLevel** and optional **fluentConfig**.
> Fluentd logging is enabled via config.
## Usage
```javascript
const createLogger = require('@vanioinformatika/express-logger').createLoggerconst logLevel = 'info'
const fluentConfig = {
enabled: true,
tag: 'application tag',
config: {
host: 'localhost',
port: 12345
}
}const logger = createLogger(logLevel, fluentConfig)
logger.info('Message')
```## Examples
Initialize logger only with console logger:
```javascript
const logger = createLogger('info')
```Initialize logger with console and fluent logger:
```javascript
const logger = createLogger('info', {
enabled: true,
tag: 'application-name',
config: {
host: 'localhost',
port: 12345
}
})
```