Skip to content

Commit

Permalink
fix: SKYOPS-73008 - add log level debug instructions in the README (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejZurekk authored May 27, 2024
1 parent fc4c9b5 commit 3fcd2a6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@ The config object can have one or more of the following keys.

The log level can also be overridden using the env variable AIO_LOG_LEVEL

### Enabling Debug Level Logging

Example of logger configuration:

```javascript
const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', {provider: 'debug'})
logger.info('info')
logger.debug('debug')
```

To see both logs:

```javascript
AIO_LOG_LEVEL = debug
DEBUG = MyModuleName
```

It is possible to set the log level from another environment variable if needed:

```javascript
const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', {provider: 'debug', level: process.env.FOOBAR})
logger.info('info')
logger.debug('debug')
```
### Using custom logger

```javascript
Expand Down

0 comments on commit 3fcd2a6

Please sign in to comment.