update logging levels

This commit is contained in:
Luke Pulverenti 2015-10-04 18:04:56 -04:00
parent 9124825c98
commit 4ad96e4ff5
13 changed files with 48 additions and 29 deletions

View File

@ -774,11 +774,11 @@ namespace Emby.Drawing
try try
{ {
_logger.Debug("Creating image collage and saving to {0}", options.OutputPath); _logger.Info("Creating image collage and saving to {0}", options.OutputPath);
_imageEncoder.CreateImageCollage(options); _imageEncoder.CreateImageCollage(options);
_logger.Debug("Completed creation of image collage and saved to {0}", options.OutputPath); _logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
} }
finally finally
{ {

View File

@ -626,7 +626,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
{ {
try try
{ {
Logger.Debug(Name + ": Cancelling"); Logger.Info(Name + ": Cancelling");
token.Cancel(); token.Cancel();
} }
catch (Exception ex) catch (Exception ex)
@ -639,16 +639,16 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
{ {
try try
{ {
Logger.Debug(Name + ": Waiting on Task"); Logger.Info(Name + ": Waiting on Task");
var exited = Task.WaitAll(new[] { task }, 2000); var exited = Task.WaitAll(new[] { task }, 2000);
if (exited) if (exited)
{ {
Logger.Debug(Name + ": Task exited"); Logger.Info(Name + ": Task exited");
} }
else else
{ {
Logger.Debug(Name + ": Timed out waiting for task to stop"); Logger.Info(Name + ": Timed out waiting for task to stop");
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@ -149,7 +149,11 @@ namespace MediaBrowser.MediaEncoding.Probing
if (!string.IsNullOrEmpty(streamInfo.sample_rate)) if (!string.IsNullOrEmpty(streamInfo.sample_rate))
{ {
stream.SampleRate = int.Parse(streamInfo.sample_rate, _usCulture); int value;
if (int.TryParse(streamInfo.sample_rate, NumberStyles.Any, _usCulture, out value))
{
stream.SampleRate = value;
}
} }
stream.ChannelLayout = ParseChannelLayout(streamInfo.channel_layout); stream.ChannelLayout = ParseChannelLayout(streamInfo.channel_layout);
@ -190,12 +194,21 @@ namespace MediaBrowser.MediaEncoding.Probing
if (!string.IsNullOrEmpty(streamInfo.bit_rate)) if (!string.IsNullOrEmpty(streamInfo.bit_rate))
{ {
bitrate = int.Parse(streamInfo.bit_rate, _usCulture); int value;
if (int.TryParse(streamInfo.bit_rate, NumberStyles.Any, _usCulture, out value))
{
bitrate = value;
}
} }
else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video)
if (bitrate == 0 && formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video)
{ {
// If the stream info doesn't have a bitrate get the value from the media format info // If the stream info doesn't have a bitrate get the value from the media format info
bitrate = int.Parse(formatInfo.bit_rate, _usCulture); int value;
if (int.TryParse(formatInfo.bit_rate, NumberStyles.Any, _usCulture, out value))
{
bitrate = value;
}
} }
if (bitrate > 0) if (bitrate > 0)
@ -518,23 +531,23 @@ namespace MediaBrowser.MediaEncoding.Probing
// These support mulitple values, but for now we only store the first. // These support mulitple values, but for now we only store the first.
var mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id")); var mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id"));
if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID"));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, mb); audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id"));
if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID"));
audio.SetProviderId(MetadataProviders.MusicBrainzArtist, mb); audio.SetProviderId(MetadataProviders.MusicBrainzArtist, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id"));
if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID"));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, mb); audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id"));
if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID"));
audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, mb); audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id"));
if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID"));
audio.SetProviderId(MetadataProviders.MusicBrainzTrack, mb); audio.SetProviderId(MetadataProviders.MusicBrainzTrack, mb);
} }

View File

@ -411,7 +411,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
} }
}; };
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); _logger.Info("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-convert-" + Guid.NewGuid() + ".txt"); var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-convert-" + Guid.NewGuid() + ".txt");
_fileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath)); _fileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath));

View File

@ -734,7 +734,7 @@ namespace MediaBrowser.Providers.MediaInfo
return minSizeVobs.Count == 0 ? vobs.Select(i => i.FullName) : minSizeVobs.Select(i => i.FullName); return minSizeVobs.Count == 0 ? vobs.Select(i => i.FullName) : minSizeVobs.Select(i => i.FullName);
} }
_logger.Debug("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path); _logger.Info("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path);
} }
var files = allVobs var files = allVobs

View File

@ -81,7 +81,7 @@ namespace MediaBrowser.Providers.MediaInfo
// Can't extract if we didn't find a video stream in the file // Can't extract if we didn't find a video stream in the file
if (!video.DefaultVideoStreamIndex.HasValue) if (!video.DefaultVideoStreamIndex.HasValue)
{ {
_logger.Debug("Skipping image extraction due to missing DefaultVideoStreamIndex for {0}.", video.Path ?? string.Empty); _logger.Info("Skipping image extraction due to missing DefaultVideoStreamIndex for {0}.", video.Path ?? string.Empty);
return Task.FromResult(new DynamicImageResponse { HasImage = false }); return Task.FromResult(new DynamicImageResponse { HasImage = false });
} }

View File

@ -143,7 +143,7 @@ namespace MediaBrowser.Server.Implementations.Channels
private async Task CleanChannel(Guid id, CancellationToken cancellationToken) private async Task CleanChannel(Guid id, CancellationToken cancellationToken)
{ {
_logger.Debug("Cleaning channel {0} from database", id); _logger.Info("Cleaning channel {0} from database", id);
// Delete all channel items // Delete all channel items
var allIds = _libraryManager.GetItemIds(new InternalItemsQuery var allIds = _libraryManager.GetItemIds(new InternalItemsQuery

View File

@ -27,7 +27,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var msg = "HTTP Response " + statusCode + " to " + endPoint + responseTime; var msg = "HTTP Response " + statusCode + " to " + endPoint + responseTime;
logger.LogMultiline(msg, LogSeverity.Debug, log); logger.LogMultiline(msg, LogSeverity.Info, log);
} }
} }
} }

View File

@ -220,7 +220,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
{ {
if (string.IsNullOrWhiteSpace(token)) if (string.IsNullOrWhiteSpace(token))
{ {
throw new SecurityException("Access token is invalid or expired."); throw new SecurityException("Access token is required.");
} }
var info = GetTokenInfo(request); var info = GetTokenInfo(request);

View File

@ -62,8 +62,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
auth.TryGetValue("Version", out version); auth.TryGetValue("Version", out version);
} }
var token = httpReq.Headers["X-MediaBrowser-Token"]; var token = httpReq.Headers["X-Emby-Token"];
if (string.IsNullOrWhiteSpace(token))
{
token = httpReq.Headers["X-MediaBrowser-Token"];
}
if (string.IsNullOrWhiteSpace(token)) if (string.IsNullOrWhiteSpace(token))
{ {
token = httpReq.QueryString["api_key"]; token = httpReq.QueryString["api_key"];

View File

@ -191,7 +191,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
var type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod; var type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod;
logger.LogMultiline(type + " " + request.Url, LogSeverity.Debug, log); logger.LogMultiline(type + " " + request.Url, LogSeverity.Info, log);
} }
private void HandleError(Exception ex, HttpListenerContext context) private void HandleError(Exception ex, HttpListenerContext context)

View File

@ -1324,7 +1324,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (existing.Items.Length > 0) if (existing.Items.Length > 0)
{ {
var token = existing.Items[0].AccessToken; var token = existing.Items[0].AccessToken;
_logger.Debug("Reissuing access token: " + token); _logger.Info("Reissuing access token: " + token);
return token; return token;
} }
@ -1340,7 +1340,7 @@ namespace MediaBrowser.Server.Implementations.Session
AccessToken = Guid.NewGuid().ToString("N") AccessToken = Guid.NewGuid().ToString("N")
}; };
_logger.Debug("Creating new access token for user {0}", userId); _logger.Info("Creating new access token for user {0}", userId);
await _authRepo.Create(newToken, CancellationToken.None).ConfigureAwait(false); await _authRepo.Create(newToken, CancellationToken.None).ConfigureAwait(false);
return newToken.AccessToken; return newToken.AccessToken;
@ -1353,6 +1353,8 @@ namespace MediaBrowser.Server.Implementations.Session
throw new ArgumentNullException("accessToken"); throw new ArgumentNullException("accessToken");
} }
_logger.Info("Logging out access token {0}", accessToken);
var existing = _authRepo.Get(new AuthenticationInfoQuery var existing = _authRepo.Get(new AuthenticationInfoQuery
{ {
Limit = 1, Limit = 1,

View File

@ -502,7 +502,7 @@ namespace MediaBrowser.Server.Startup.Common
LiveTvManager = new LiveTvManager(this, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager); LiveTvManager = new LiveTvManager(this, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager);
RegisterSingleInstance(LiveTvManager); RegisterSingleInstance(LiveTvManager);
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, PlaylistManager, CollectionManager, ServerConfigurationManager); UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
RegisterSingleInstance(UserViewManager); RegisterSingleInstance(UserViewManager);
var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager, MediaSourceManager); var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager, MediaSourceManager);
@ -944,7 +944,7 @@ namespace MediaBrowser.Server.Startup.Common
Logger.ErrorException("Error sending server restart notification", ex); Logger.ErrorException("Error sending server restart notification", ex);
} }
Logger.Debug("Calling NativeApp.Restart"); Logger.Info("Calling NativeApp.Restart");
NativeApp.Restart(_startupOptions); NativeApp.Restart(_startupOptions);
} }