add serverId to the log
This commit is contained in:
parent
544671c585
commit
7f7d6cddcc
|
@ -66,7 +66,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await new UsageReporter(_applicationHost, _httpClient, _userManager)
|
await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger)
|
||||||
.ReportAppUsage(client, CancellationToken.None)
|
.ReportAppUsage(client, CancellationToken.None)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await new UsageReporter(_applicationHost, _httpClient, _userManager)
|
await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger)
|
||||||
.ReportServerUsage(CancellationToken.None)
|
.ReportServerUsage(CancellationToken.None)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Model.Logging;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.EntryPoints
|
namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
|
@ -16,13 +17,15 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
private readonly IApplicationHost _applicationHost;
|
private readonly IApplicationHost _applicationHost;
|
||||||
private readonly IHttpClient _httpClient;
|
private readonly IHttpClient _httpClient;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
|
private readonly ILogger _logger;
|
||||||
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
|
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;
|
_applicationHost = applicationHost;
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task ReportServerUsage(CancellationToken cancellationToken)
|
public Task ReportServerUsage(CancellationToken cancellationToken)
|
||||||
|
@ -58,6 +61,12 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||||
throw new ArgumentException("Client info must have a device Id");
|
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();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var data = new Dictionary<string, string>
|
var data = new Dictionary<string, string>
|
||||||
|
|
|
@ -321,6 +321,7 @@ namespace MediaBrowser.Server.Startup.Common
|
||||||
{
|
{
|
||||||
await base.RunStartupTasks().ConfigureAwait(false);
|
await base.RunStartupTasks().ConfigureAwait(false);
|
||||||
|
|
||||||
|
Logger.Info("ServerId: {0}", SystemId);
|
||||||
Logger.Info("Core startup complete");
|
Logger.Info("Core startup complete");
|
||||||
HttpServer.GlobalResponse = null;
|
HttpServer.GlobalResponse = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user