@evo/logevo v2.0.0
logevo js
Javascript implementation of logevo-py
Installation
npm install --save @evo/logevo
Deploy
This package will be deployed automatically to @evo/logevo by a tag. To create a valid tag, please, execute the following:
git checkout master
git pull origin master --rebase
npm version (patch|minor|major)
git push origin master --tags
Usage example
import { logger, configureLogging } from '@evo/logevo';
configureLogging();
// logger API
logger.debug('test debug');
logger.info('test info');
logger.warn('test warn');
// errors
logger.error(error); // will log all error info
logger.error('test error', { extra: { error: errorInstance }}); // or custom message with error
Tests
# unit tests
make test-unit
# integration tests
make test-int
Publish
Package is published by tag
git checkout master
git pull
npm version patch|minor|major
git push origin master --tags
Logging extra
Some extra data.
logger.debug('test debug', { extra: { meta: 'data' } })
extra field works with the same principle as described here
Logging txid
txid is used for tracking user session id across multiple services.
logger.debug('test debug', { txid: 'txid-uuid' });
tags
If you want to add some extra tags to log msg, you can make it with extra.tags property
logger.info('msg', { extra: { tags: ['tag1']}});
Configuration
ENV config for Console logger (dev environment)
APP_NAME
Set's application prefix to the resulting log Example:
# APP_NAME=SSR
SSR 13:50:09 [DEBUG]: Rendering companysite_mobile
LOGEVO_LEVEL
Minimal log level. Available levels: DEBUG, INFO, WARNING, ERROR. Default is INFO.
LOGEVO_COLOR
1 - enables colorized output. 0 - disables colorized output.
ENV config for the Syslog (prod environment)
SYSLOG_FACILITY
Syslog facility
SYSLOG_APP_NAME
Specifies syslog application name (will be added to log)
LITHOS_NAME
The same as SYSLOG_APP_NAME
LOGEVO_LEVEL
Minimal log level. Available levels: DEBUG, INFO, WARNING, ERROR. Default is WARNING.
LOGEVO_APPVERSION
Set's application version (will be added to syslog message)
Uncaught exceptions
Logs them by default
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago