1.0.30 • Published 1 year ago

log4js-node-next v1.0.30

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

log4js-promises

This is a next possible conversion of the log4j framework to work with node. It is a also alternative for original template for this project log4js. Main differences between log4js and this project is, that this is full promised based and strongly typed project (minimize of using any) full ready for esnext.

The full documentation is available here.

Internal implementation of appenders:

  • console
  • file
  • std-err
  • loglevel
  • custom

Example of custom appenders:

Simple example

if (require.main === module) {
    configureLogger({
        appenders: {
            consoleAppender: {
                type: eCoreAppenderType.console,
                layout: {
                    type: 'COLORED_CONSOLE',
                    appName: 'appName',
                    source: 'develop',
                    static: {
                        env: {
                            host: 'config.http.balancerHost',
                        },
                    },
                    stringFormat: {
                        colors: true,
                    },
                },
            },
            consoleAppenderByLevel: {
                type: eCoreAppenderType.logLevelFilter,
                appender: 'consoleAppender',
                monLevel: logLevels.DEBUG,
                maxLevel: logLevels.ERROR,
            },
        },
        categories: {
            default: {
                appenders: ['consoleAppenderByLevel'],
            },
        },
    })
        .then(() => {
            const logger = getLogger();
            logger.debug('This is a message');
        })
        .catch((err) => {
            console.debug(err);
        });
}
[2024-01-28T16:56:57.745] [DEBUG] [default] - "This is a message"
1.0.29

1 year ago

1.0.30

1 year ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago