1.0.30 • Published 4 months ago

log4js-node-next v1.0.30

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months 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

4 months ago

1.0.30

4 months ago

1.0.28

6 months ago

1.0.27

6 months ago

1.0.26

6 months ago

1.0.23

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago