<!-- Source: https://www.wappi.dev/logging -->

# Built in Observability

Wappi includes comprehensive logging capabilities to help you monitor, debug, and maintain your API. Logging is essential for understanding how your API is performing and identifying issues in production. Wappi's goal with observability is to be able to find any issue within 2 minutes, with verbose observability.

## Built-in Logging

Wappi automatically logs all incoming requests and error responses, including:

- Request headers and body
- Body
- Auth Details - From the Login Auth Token
- Error details and stack traces

## Make Logging Simple

All endpoints are between a `try / catch`. Any errors will be caught in the catch and logged to your place of choice.

## Default Logs

All the logs will be logged to the console by default. So when you deploy wappi, they will be in the success and error.logs files on the server.

## Custom Logs

By default all logs will pass through the folder path: **/API/CoreHelpers/logging.ts**
Customize your logs, by adding your own code into this file.
Some implementations have been sending every log to DataDog, Splunk and CloudWatch.

## Best Practices

Observability is really important when programming.
Make sure that you always throw ALL errors, so they are caught in the catch.
Send all your logs to an observability platform, so you have instant access to errors and warnings.
On Production, make sure your "SHOW_LOGS" environment variable is set to false. So that you are not showing sensitive production data, and to conserve space on your log files.

```bash
SHOW_LOGS=false
```

URL: https://www.wappi.dev/logging
