Skip to content

massimo-ua/log4js-pg-appender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log4js-pg-appender

Simple Log4js postgresql appender

Installation

log4js-pg-appender tested with log4js v3+.

Before you start create table to store records produced by adapter

CREATE TABLE public."Logs" (
    "startTime" timestamp with time zone NOT NULL,
    "categoryName" character varying(255) NOT NULL,
    data json NOT NULL,
    level character varying(255),
    context json
);

Next install package

npm install --save @simoware/log4js-pg-appender

Then add appender to log4js configuration

{
  appenders: {
    console: {type: 'console'},
    db: {
      type: 'log4js-pg-appender',
      connectionString: 'postgresql://logger:test@postgres/test',
    },
  },
  categories: {
    default: {appenders: ['console', 'db'], level: 'debug'},
  },
}

About

Simple Log4js postgresql appender

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published