2.0.0 • Published 2 years ago

@evo/logevo v2.0.0

Weekly downloads
1,661
License
ISC
Repository
gitlab
Last release
2 years ago

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

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

2.0.0

2 years ago

1.3.3

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago