fix(ugc): name crash dumps like the other servers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 09:40:24 -05:00
parent 5828fe99c7
commit 0de9decc7c
3 changed files with 6 additions and 4 deletions

View File

@@ -248,7 +248,9 @@ namespace {
}
int main(int argc, char** argv) {
Diagnostics::SetProcessName("Ugc");
// Crash dumps and the log file share this name (Crash_UgcServer_<start time>_<pid>.log), like the other servers
const auto serviceName = "UgcServer_" + std::to_string(time(nullptr));
Diagnostics::SetProcessName(serviceName);
Diagnostics::SetProcessFileName(argv[0]);
Diagnostics::Initialize();
Diagnostics::SetProduceMemoryDump(true);
@@ -263,7 +265,7 @@ int main(int argc, char** argv) {
}
// Like the other servers: logs/UgcServer/UgcServer_<start time>.log
Server::SetupLogger("UgcServer_" + std::to_string(time(nullptr)), "UgcServer");
Server::SetupLogger(serviceName, "UgcServer");
if (!Game::logger) return EXIT_FAILURE;
// Crash reports go where the dashboard lists them (Server Health, crash dumps)
if (!Game::config->GetValue("dump_folder").empty()) Diagnostics::SetOutDirectory(Game::config->GetValue("dump_folder"));

View File

@@ -662,7 +662,7 @@ the newest log files of one or all servers.
The UGC server's logs are `UgcServer_<time>.log`, listed with the others.
Crash dumps: set `dump_folder` (for example `crash_dumps`, relative to the server binaries) and world servers and the
UGC server write a backtrace file there when they crash (the UGC server's is `crash_Ugc_<pid>.log`; `generate_dump=1` also
UGC server write a backtrace file there when they crash (the UGC server's is `Crash_UgcServer_<start time>_<pid>.log`; `generate_dump=1` also
writes a memory dump on Windows). Server Health lists them
to read or download for staff who also have `logs_system`.

View File

@@ -148,7 +148,7 @@ list (enabled, connected, process ID). On the dashboard it shows on the home pag
for `health_view`: up time, waiting/made/failed, busy workers and storage), on Server Health (uptime history and the
Servers table with its process memory and CPU), on Diagnostics (its packets and HTTP requests, from the traffic report
it sends every 5 seconds with its workers, totals and storage), in the `server` webhook alerts when it goes down or
comes back, in the System Log (`UgcServer_*.log`) and crash dumps (`crash_Ugc_<pid>.log` in `dump_folder`), and in
comes back, in the System Log (`UgcServer_*.log`) and crash dumps (`Crash_UgcServer_<start time>_<pid>.log` in `dump_folder`), and in
Prometheus (`darkflame_ugc_up`, `darkflame_ugc_items`, `darkflame_server_ugc_*{server="ugc"}`). See docs/Dashboard.md.
The UGC Server page (`/ugc`, Server Admin menu; `properties_view` to look, the new `ugc_manage` permission to make