0.1.93 • Published 4 years ago

@shipyardsuite/logger v0.1.93

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

logger

Custom logger for Shipyard GCDN

Installation

Install via npm install @shipyardsuite/logger.

the logger needs the following environment variables to run:

  • SERVICE_NAME: Name of service, the logger belongs to, defaults to "undefined"
  • REDIS_URL: URL of redis database/image.
  • REDIS_PORT: Port of redis database.
  • REDIS_PASSWORD: Password of redis database.
  • REDIS_COLLECTION: Name of redis collection to save logs in, default is 'logs'

Initialization:

import { Logger } from '@shipyardsuite/logger';

Usage

create a new instane of the logger with:

const logger = new Logger();

the following types of log-messages can be created:

Message.info()

Message.debug()

Message.warning()

Message.error()

The logger can take a javascript object for logging informations, for example:

logger.Message.debug({ 
    action: 'Testing server', 
    port: this.port 
});

the output will automatically serve the following informations:

  • timestamp: Current timestamp of log.
  • loglevel: Level of log, i.e. info, debug, warning, error
  • service: The name of the currently running service.

License

This project is released under the Apache version 2 license.

0.1.92

4 years ago

0.1.93

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago