GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - strigo/strigo-node-logger: Strigo's logger for node applications

BranchesTags
Open more actions menu

Latest commit

 

History

43 Commits
43 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github
.github
 
 
.vscode
.vscode
 
 
examples
examples
 
 
format
format
 
 
setup
setup
 
 
test
test
 
 
.babelrc
.babelrc
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
constants.js
constants.js
 
 
index.d.ts
index.d.ts
 
 
index.js
index.js
 
 
package.json
package.json
 
 
utils.js
utils.js
 
 

Repository files navigation

strigo-node-logger

A NodeJS logger instrumentation library for Strigo applications.

This is a light abstraction over a common logger. It provides a way to setup the logger for various applications, defaults as to where to direct logs in different cases, and a way to determine context for entries in a generic way.

The logger is built around the winston logger, and express-winston when used as middleware for Express.js.

Make sure to go over the winston & express-winston docs to know the API of the logger. For Express.js specifically, make sure to read this about binding order of the error logging middleware.

Installation

Add "@strigo/node-logger": "strigo/strigo-node-logger.git#TAG" to your package.json.

Usage

In a vanilla node application

import { setupNodeLogger } from '@strigo/node-logger';

const log = setupNodeLogger({ json = true, level = 'info' });

log.info(...);

log.level = 'debug';
log.debug(...);
// And so on...

In an ExpressJS application

import { setupExpressLogger } from '@strigo/node-logger';

const { log, loggerMiddleware, errorLoggerMiddleware } = setupExpressLogger({});

app.use(loggerMiddleware);

// read docs about error logger
app.use(errorLoggerMiddleware);

log.info(...);

// And so on...

Check examples for more info.

About

Strigo's logger for node applications

Topics

ecselastic-common-schemalogginglogging-librarynodejs

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

5 watching

Forks

3 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.