# Logging

Effective logging enables developers to monitor API behavior, diagnose issues, and improve application performance. It provides insights into application flow, helps in identifying bottlenecks, and ensures that the API responds correctly to requests.

{% embed url="<https://getpino.io>" %}

Pino is a fast, low-overhead logging library that is commonly used with Fastify, a web framework that prioritizes speed and efficiency. It offers minimal performance impact while providing rich logging capabilities essential for robust application monitoring.

In development environments, `pino-pretty` is often used in conjunction with Pino to format logs for better readability.

## Usage

You can use logging by using the `novel/logger` library

{% code title="feature.ts" lineNumbers="true" %}

```typescript
import logger from 'novel/logger';

logger.info('Something happened');
logger.error('Something is wrong');
logger.fatal('HELP!');
```

{% endcode %}

It follows the pino logging signature.

If you are looking for Events or Account Activities or Organization Activities, check it in their own documentation below

[Events →](https://docs.novel.dev/novel-server/events)

[Account Activities →](https://docs.novel.dev/novel-server/users#activities)

[Organization Activities →](https://docs.novel.dev/novel-server/organizations#activities)

## Changelog

* 2024-12-20 - Initial Documentation


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novel.dev/novel-server/logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
