From 2712ba83f0191320a4385a898fea95ac770ecb23 Mon Sep 17 00:00:00 2001 From: sii21565 Date: Mon, 27 May 2024 11:59:30 +0200 Subject: [PATCH] SKYOPS-73008 --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 56ae685..cfe2d06 100644 --- a/README.md +++ b/README.md @@ -45,23 +45,27 @@ The log level can also be overridden using the env variable AIO_LOG_LEVEL ### Enabling Debug Level Logging -Set the 'AIO_LOG_LEVEL' environmental variable to 'debug' +Example of logger configuration: ```javascript -AIO_LOG_LEVEL = debug +const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', {provider: 'debug'}) +logger.info('info') +logger.debug('debug') ``` -Set the 'DEBUG' environment variable: -To enable debug logging for all modules, set the 'DEBUG' environment variable to 'AIO': +To see both logs: ```javascript -DEBUG = AIO +AIO_LOG_LEVEL = debug +DEBUG = MyModuleName ``` -If you want to enable debug logging for all available logs, set the 'DEBUG' variable to '*': +It is possible to set the log level from another environment variable if needed: ```javascript -DEBUG = * +const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', {provider: 'debug', level: process.env.FOOBAR}) +logger.info('info') +logger.debug('debug') ``` ### Using custom logger