Skip to content

Commit

Permalink
feat(packages/sui-logger): improve the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nucliweb committed Oct 14, 2024
1 parent 34b4801 commit 7db4964
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/sui-logger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ Enabled by default, there is a ENV var to disable it `DISABLE_SERVER_LOGGER_PATC

#### With Reporter

> The Reporter needs a `star` method to inicialize the reporter.
```js
export const initTracker = ({Reporter, appName, environment, version, tenant, ...config}) => {
const context = {environment: environment || NODE_ENV, isServer, version, tenant}

Reporter.start(appName, {
...config,
context
})
}
```

To start logging server-side logs in our application, we should initialize our tracker in one server file

```js
Expand All @@ -119,7 +132,7 @@ Options:
- **`devMode` {String}** - Allows sending events to the development endpoint, Production endpoint is used by default.
- **`...rest`** - See your Service Logger client configuration

After initializing our tracker, we could create our logger
After initializing our tracker, we could create our logger.

```js
import {createServerLogger} from '@s-ui/logger'
Expand Down

0 comments on commit 7db4964

Please sign in to comment.