> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overlayed.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Logging

> Comprehensive file and console logging for your Overlayed application

The Overlayed logging module provides comprehensive file and console logging for your application.

## About

* Logs are saved to files in your application's log directory
  * `%APPDATA%\overlayed\<applicationId>\logs`
* Logs are saved to files based on date
* Logs are automatically deleted after 7 days

## Log Levels

The logging module supports multiple log levels:

* **`debug`** - Detailed information for debugging purposes
* **`info`** - General information about application state
* **`warn`** - Warnings that don't stop execution but should be noted
* **`error`** - Errors that may affect functionality

## Using the Logger

### Basic Logging

```typescript theme={null}
overlay.logger.debug("Overlay initialized successfully");
overlay.logger.info("Game session started", { gameId: "siege" });
overlay.logger.warn("High memory usage detected", { usage: "85%" });
overlay.logger.error("Failed to load game module", { error: errorDetails });
```

<Info>When log arguments are written to file, they're processed with JSON.stringify().</Info>

### Infinite Arguments

All log methods accept an infinite number of arguments.

```typescript theme={null}
overlay.logger.info(
	"Player action performed",
	{
		playerId: "player123",
		action: "kill",
		timestamp: Date.now(),
		gameMode: "ranked",
	},
    {
        someAdditionalData: "someValue",
    }
});
```

## File Output

Logs are also written to files in your application's log directory:

* `app.log` - Your application's logs
* `main.log` - Overlayed's logs
