[PR #904] [MERGED] Server log: vanilla's thread in latest.log, and local time on the console #2898

Closed
opened 2026-11-02 15:59:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/904
Author: @ludovic111
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-log-lines


📝 Commits (1)

  • bdc758c Server log: vanilla's thread in latest.log, and local time on the console

📊 Changes

5 files changed (+20 additions, -17 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+5 -9)
📝 crates/horizon-client/src/logging.rs (+8 -0)
📝 crates/horizon-server/Cargo.toml (+2 -0)
📝 crates/horizon-server/src/supervisor.rs (+4 -8)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

docs/server.md §10 item 5 (refused logins in vanilla's lines) is merged (e7003e7d). The end-to-end install check found two leftovers in how those lines reach the files.

What

  1. logs/latest.log named the wrong thread. The console printed a refused login as vanilla does, [Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:50142): You are not white-listed on this server!. The file had [horizon-lan-conn/INFO] instead: the file logger used the OS thread's name, not the thread vanilla logs the line from. The engine's lines now go to the file under the same thread as on the console (logging::write_as).
  2. The console's times were UTC. logs/latest.log and vanilla's console (Log4j's %d{HH:mm:ss}) use local time. So the engine's stdout, which is logs/supervisor.log and the web panel's console, disagreed with latest.log by the time zone, as did the supervisor's own [Supervisor/…] lines. Both now print local time (chrono::Local, already in the tree; horizon-server gains it with default-features = false). Backup names keep their UTC time, as docs/server.md §7 says.

The harnesses compare the console lines (already right, and they run with -Duser.timezone=UTC), not latest.log, which is why this went unseen.

Verified (Mac mini, this branch's binaries under horizon-server, a vanilla protocol client refused by the whitelist)

-- logs/latest.log
[19:16:10] [Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:58340): You are not white-listed on this server!
[19:16:10] [Server thread/INFO]: Stranger (/127.0.0.1:58340) lost connection: You are not white-listed on this server!
-- logs/supervisor.log (the console)
[19:15:16] [Supervisor/INFO]: Starting /tmp/sh8/logbin/horizon-client with the game files in ...
[19:16:10] [Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:58340): You are not white-listed on this server!
[19:16:10] [Server thread/INFO]: Stranger (/127.0.0.1:58340) lost connection: You are not white-listed on this server!

Before (v2026.10.18.15): latest.log had [17:47:07] [horizon-lan-conn/INFO]: Disconnecting … while supervisor.log had [15:47:07] [Server thread/INFO]: Disconnecting ….

Self-check

cargo fmt --all -- --check                                                      ok
cargo clippy -p horizon-client -p horizon-server --all-targets -- -D warnings  ok
cargo test -p horizon-client                                                    876 + 74 + ... passed, 0 failed
cargo test -p horizon-server                                                    24 passed
tools/parity.py dedicated_server online_mode                                    2 passed (520 s, 408 s)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/904 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-log-lines` --- ### 📝 Commits (1) - [`bdc758c`](https://github.com/horizon-rust/horizon/commit/bdc758c5e5ed6cb1d704f4f4c996f39349762aae) Server log: vanilla's thread in latest.log, and local time on the console ### 📊 Changes **5 files changed** (+20 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+5 -9) 📝 `crates/horizon-client/src/logging.rs` (+8 -0) 📝 `crates/horizon-server/Cargo.toml` (+2 -0) 📝 `crates/horizon-server/src/supervisor.rs` (+4 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. docs/server.md §10 item 5 (refused logins in vanilla's lines) is merged (e7003e7d). The end-to-end install check found two leftovers in how those lines reach the files. ## What 1. **`logs/latest.log` named the wrong thread.** The console printed a refused login as vanilla does, `[Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:50142): You are not white-listed on this server!`. The file had `[horizon-lan-conn/INFO]` instead: the file logger used the OS thread's name, not the thread vanilla logs the line from. The engine's lines now go to the file under the same thread as on the console (`logging::write_as`). 2. **The console's times were UTC.** `logs/latest.log` and vanilla's console (Log4j's `%d{HH:mm:ss}`) use local time. So the engine's stdout, which is `logs/supervisor.log` and the web panel's console, disagreed with `latest.log` by the time zone, as did the supervisor's own `[Supervisor/…]` lines. Both now print local time (`chrono::Local`, already in the tree; horizon-server gains it with `default-features = false`). Backup names keep their UTC time, as docs/server.md §7 says. The harnesses compare the console lines (already right, and they run with `-Duser.timezone=UTC`), not `latest.log`, which is why this went unseen. ## Verified (Mac mini, this branch's binaries under `horizon-server`, a vanilla protocol client refused by the whitelist) ``` -- logs/latest.log [19:16:10] [Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:58340): You are not white-listed on this server! [19:16:10] [Server thread/INFO]: Stranger (/127.0.0.1:58340) lost connection: You are not white-listed on this server! -- logs/supervisor.log (the console) [19:15:16] [Supervisor/INFO]: Starting /tmp/sh8/logbin/horizon-client with the game files in ... [19:16:10] [Server thread/INFO]: Disconnecting Stranger (/127.0.0.1:58340): You are not white-listed on this server! [19:16:10] [Server thread/INFO]: Stranger (/127.0.0.1:58340) lost connection: You are not white-listed on this server! ``` Before (v2026.10.18.15): `latest.log` had `[17:47:07] [horizon-lan-conn/INFO]: Disconnecting …` while `supervisor.log` had `[15:47:07] [Server thread/INFO]: Disconnecting …`. ## Self-check ``` cargo fmt --all -- --check ok cargo clippy -p horizon-client -p horizon-server --all-targets -- -D warnings ok cargo test -p horizon-client 876 + 74 + ... passed, 0 failed cargo test -p horizon-server 24 passed tools/parity.py dedicated_server online_mode 2 passed (520 s, 408 s) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:59:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2898
No description provided.