diff --git a/src/Sentry/GlobalSessionManager.cs b/src/Sentry/GlobalSessionManager.cs index bb77dd0448..74cfa3fb62 100644 --- a/src/Sentry/GlobalSessionManager.cs +++ b/src/Sentry/GlobalSessionManager.cs @@ -51,6 +51,11 @@ public GlobalSessionManager(SentryOptions options) Directory.CreateDirectory(directoryPath); + _options.DiagnosticLogger?.LogDebug( + "Created directory for installation ID file ({0}).", + directoryPath + ); + var filePath = Path.Combine(directoryPath, ".installation"); // Read installation ID stored in a file @@ -94,6 +99,7 @@ public GlobalSessionManager(SentryOptions options) { try { + // Get MAC address of the first network adapter var installationId = NetworkInterface .GetAllNetworkInterfaces() .Where(nic => @@ -105,7 +111,7 @@ public GlobalSessionManager(SentryOptions options) if (string.IsNullOrWhiteSpace(installationId)) { _options.DiagnosticLogger?.LogError( - "Failed to resolve hardware installation ID." + "Failed to find an appropriate network interface for installation ID." ); return null; @@ -145,7 +151,8 @@ public GlobalSessionManager(SentryOptions options) var id = TryGetPersistentInstallationId() ?? - TryGetHardwareInstallationId(); + TryGetHardwareInstallationId() ?? + Environment.MachineName; if (!string.IsNullOrWhiteSpace(id)) {