diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-12-30 02:11:58 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-12-30 02:11:58 -0500 |
| commit | 7f7d6cddcc97904f9923e9878d22b60d4f8e8d2c (patch) | |
| tree | 990219990b5069c61728e5cd892c159ef5782184 /MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs | |
| parent | 544671c58514a91e13485247eaf73d00bbae30ef (diff) | |
add serverId to the log
Diffstat (limited to 'MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs index 77dd54a80..5496bd9b2 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs @@ -8,6 +8,7 @@ using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.EntryPoints { @@ -16,13 +17,15 @@ namespace MediaBrowser.Server.Implementations.EntryPoints private readonly IApplicationHost _applicationHost; private readonly IHttpClient _httpClient; private readonly IUserManager _userManager; + private readonly ILogger _logger; private const string MbAdminUrl = "http://www.mb3admin.com/admin/"; - public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager) + public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger) { _applicationHost = applicationHost; _httpClient = httpClient; _userManager = userManager; + _logger = logger; } public Task ReportServerUsage(CancellationToken cancellationToken) @@ -47,7 +50,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints data["linkedusers"] = users.Count(i => i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.LinkedUser).ToString(CultureInfo.InvariantCulture); data["plugins"] = string.Join(",", _applicationHost.Plugins.Select(i => i.Id).ToArray()); - + return _httpClient.Post(MbAdminUrl + "service/registration/ping", data, cancellationToken); } @@ -58,6 +61,12 @@ namespace MediaBrowser.Server.Implementations.EntryPoints throw new ArgumentException("Client info must have a device Id"); } + _logger.Info("App Activity: app: {0}, version: {1}, deviceId: {2}, deviceName: {3}", + app.AppName ?? "Unknown App", + app.AppVersion ?? "Unknown", + app.DeviceId, + app.DeviceName ?? "Unknown"); + cancellationToken.ThrowIfCancellationRequested(); var data = new Dictionary<string, string> |
