api-client/packages
Shreyas fbeb0e56be
feat(desktop): file-based logs with rotation (#5009)
This PR adds a file-based logging system with size-based rotation to the desktop application. It essentially redirects existing diagnostic to size-based rotating files for troubleshooting environment-specific issues.

Closes HFE-801

The desktop application currently lacks a persistent logging mechanism in production environments. Logs are only available through the development mode console.

This PR will help diagnose issues reported in #4859, #4950, #5003, discussions #4984 and #4986.

Mainly aiming to understand errors in specific environments that can't be reproduced in our testing setups.

This implementation uses the tracing ecosystem (`tracing`, `tracing_subscriber`, `tracing_appender`) along with `file_rotate` to create log files in the platform's log directory. The logs are automatically rotated when they reach `10MB`, with a maximum of `5` files retained.

Thinking 10 * 5 MB is reasonable disk usage while maintaining sufficient history.

The system currently writes to both the console (with ANSI colors where supported) and to files (without ANSI formatting for readability). Log levels are currently controlled via the `RUST_LOG` environment variable, defaulting to "debug" when not specified.

| OS      | Log File Path                                        |
|---------|------------------------------------------------------|
| Windows | `C:\Users\<username>\AppData\Local\io.hoppscotch.desktop\logs\io.hoppscotch.desktop.log` |
| macOS   | `~/Library/Logs/io.hoppscotch.desktop/io.hoppscotch.desktop.log` |
| Linux   | `~/.local/share/io.hoppscotch.desktop/logs/io.hoppscotch.desktop.log` |
2025-04-25 17:09:51 +05:30
..
codemirror-lang-graphql feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
hoppscotch-agent chore: bump version to 2025.3.1 2025-04-09 19:47:01 +05:30
hoppscotch-backend chore: bump version to 2025.3.2 2025-04-15 13:16:56 +05:30
hoppscotch-cli chore: bump vulnerable dependencies (#4943) 2025-03-27 22:45:29 +05:30
hoppscotch-common chore(i18n): update es translation (#4999) 2025-04-24 16:59:47 +05:30
hoppscotch-data fix: resolve typos across packages (#4867) 2025-03-12 13:53:08 +05:30
hoppscotch-desktop feat(desktop): file-based logs with rotation (#5009) 2025-04-25 17:09:51 +05:30
hoppscotch-js-sandbox feat: add support for Digest authorization (#4339) 2024-10-29 12:34:40 +05:30
hoppscotch-kernel fix(kernel): deterministic form data processing (#4945) 2025-04-08 14:50:04 +05:30
hoppscotch-relay feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
hoppscotch-selfhost-desktop chore: bump vulnerable dependencies (#4943) 2025-03-27 22:45:29 +05:30
hoppscotch-selfhost-web chore: bump version to 2025.3.2 2025-04-15 13:16:56 +05:30
hoppscotch-sh-admin refactor(sh-admin): dashboard settings page redesign (#5014) 2025-04-24 20:24:32 +05:30