You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/com.unity.multiplayer.samples.coop/Utilities/Net/DedicatedServer/DedicatedServerUtilities.cs
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,34 @@ public static bool IsServerBuildTarget
22
22
}
23
23
}
24
24
25
-
// todo improve perf on this, don't do string concatenation everywhere, especially if log level is too high
26
-
// TODO use json structure for log analysis tools (kibana, elasticsearch, etc)
27
-
// todo find a way to disable full stack trace if needed, this could take a lot of resources.
28
-
// Logging format should change following which logging analytics service you use. Elasticsearch could
29
-
// require a different format than splunk for example.
25
+
/// <summary>
26
+
/// With dedicated server, you don't have a view into your game like you'd have with other types of platforms. You'll rely on logging a lot to get
27
+
/// insights into what's happening on your server.
28
+
/// Unity's default logging isn't usable for dedicated server use cases. The following requirements are missing:
29
+
/// - Structured logging: with 1000+ server fleets, you don't want to look at log files individually. You'll need log ingestion/analysis tools to be able
30
+
/// to parse all that data (think tools like elasticsearch for example). Making your logs structured so they are machine friendly (for example
31
+
/// having each log entry be a json object) makes this easier to integrate with those tools
32
+
/// - Log levels: most of the time, you won't want to receive info logs, only warnings and errors (so you don't spam your analysis tools and so they don't
33
+
/// cost your a fortune). However, you'll also want to enable info and debug logs for specific servers when debugging them. Having a logger that
34
+
/// manages this for you is better than wrapping your logs yourself and managing this yourself.
35
+
/// - Log file rotation: Dedicated servers can run for days and days, while normal games will run for a few play sessions before being closed. This means your
36
+
/// log file will grow and grow. Rotation is an automated way to swap log files each x hours/days. This allows deleting older log files and allows for more manageable
37
+
/// log files in general.
38
+
/// - Performance: logging can be a performance costly operation, which contributes to your CPU perf costs, which in turn are translated to hosting monetary costs.
39
+
/// Having a logging library that's optimized for these scenarios is essential (burstable, threaded, etc).
40
+
/// This also includes not having to print full stack traces (not needed for most devops operations, but could be enabled for debugging)
41
+
///
42
+
/// A few solutions exists for this. ZLogger https://github.com/Cysharp/ZLogger and serilog https://www.nuget.org/packages/serilog/ for example
43
+
/// Unity also has an experimental package com.unity.logging that answers the above needs as well. Once this is out of experimental, this will be
0 commit comments