fix: follow main's log folders in the dashboard and UGC server

Servers now log to logs/<Server>/ (worlds to logs/WorldServer/<zone>/<clone>/) with the start time in the file name.
The dashboard and UGC server log the same way, and the System Log page and log search read the whole folder tree
instead of only the top of logs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 09:39:53 -05:00
parent b7923e722d
commit 54ad477b19
4 changed files with 13 additions and 7 deletions

View File

@@ -228,12 +228,14 @@ namespace {
uintmax_t size{};
};
// Every log file, by server (the name before the start time, e.g. "WorldServer_1200_3"), newest first
// Every log file, by server (the name before the start time, e.g. "WorldServer_1200_0_3"), newest first. Servers
// write into their own folders (logs/WorldServer/<zone>/<clone>/, logs/AuthServer/, ...), so the whole tree is read.
std::map<std::string, std::vector<LogFile>> LogFilesByServer() {
std::map<std::string, std::vector<LogFile>> byServer;
const auto logDir = BinaryPathFinder::GetBinaryDir() / "logs";
std::error_code ec;
for (const auto& entry : std::filesystem::directory_iterator(logDir, ec)) {
for (auto it = std::filesystem::recursive_directory_iterator(logDir, ec); !ec && it != std::filesystem::recursive_directory_iterator(); it.increment(ec)) {
const auto& entry = *it;
if (!entry.is_regular_file(ec) || entry.path().extension() != ".log") continue;
const auto stem = entry.path().stem().string();
const auto written = std::chrono::duration_cast<std::chrono::seconds>(