> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/cms/getting-started/troubleshooting/log-manager.md).

# Log Manager

Two tools are provided for manual cleanup of existing large log files:

### Option 1: Web Interface (Recommended)

Access the web-based log manager in your browser:

```
https://your-site.com/rw/elements/com.realmac.corepack/api/log-manager.php
```

#### **First Time Setup:**

1. Access the URL in your browser
2. You'll see a first-time setup screen
3. Create a secure password (minimum 6 characters)
4. Password is saved and persists across updates
5. View stats and clean up logs with a click

#### Password Reset

If you ever need to reset your password, simply delete the following file from your server:

`/rw/elements/com.realmac.corepack/api/.log-manager-password`

The next time you access the Log Manager, you’ll be prompted to create a new password.

<figure><img src="https://1253728315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTf3DR4s6R7zTFZDxsRx4%2Fuploads%2F4KiljMbsJukaBMJQvs0Z%2FCleanShot%202025-10-24%20at%2011.47.54%402x.png?alt=media&amp;token=c7348978-6d69-4028-838e-0c022d408684" alt=""><figcaption></figcaption></figure>

Once you’ve set a password and logged in, you’ll gain access to the Log Manager dashboard. From there, you can easily review log statistics, clean up all logs at once, or view and remove individual log files as needed.

<figure><img src="https://1253728315-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTf3DR4s6R7zTFZDxsRx4%2Fuploads%2F7nXp9rhfSxofIdYtccW6%2FCleanShot%202025-10-24%20at%2012.07.08%402x.png?alt=media&amp;token=901e4264-fda7-4ae7-ac53-b97d73c22038" alt=""><figcaption></figcaption></figure>

### Option 2: Command Line Utility

For users with SSH access:

```bash
# Show current log statistics
php cleanup-logs.php --stats

# Preview what would be deleted (dry run)
php cleanup-logs.php --dry-run

# Clean logs older than 7 days (default)
php cleanup-logs.php

# Clean logs older than 30 days
php cleanup-logs.php --days=30

# Show help
php cleanup-logs.php --help
```

#### Running the Cleanup Script Manually

1. Navigate to the API directory:

   ```bash
   cd /path/to/your/site/rw/elements/com.realmac.corepack/api/
   ```
2. Run the script:

   ```bash
   php cleanup-logs.php --stats
   ```
3. Review the output and then run cleanup:

   ```bash
   php cleanup-logs.ph
   ```

#### Optional: Set Up Cron Job

For high-traffic sites, set up a weekly cron job:

```bash
# Edit crontab
crontab -e

# Add weekly cleanup (every Sunday at 2am)
0 2 * * 0 /usr/bin/php /path/to/rw/elements/com.realmac.corepack/api/cleanup-logs.php --days=7 > /dev/null 2>&1
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements-docs/cms/getting-started/troubleshooting/log-manager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
