Skip to content

Commit

Permalink
SKYOPS-73008
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejZurekk committed May 27, 2024
1 parent c758eb7 commit 2712ba8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2712ba8

Please sign in to comment.