mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 07:45:26 +03:00
3.0.5464.40000
This commit is contained in:
@@ -14,6 +14,8 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||
/// </summary>
|
||||
private readonly NLog.Logger _logger;
|
||||
|
||||
private readonly ILogManager _logManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _lock object
|
||||
/// </summary>
|
||||
@@ -23,8 +25,10 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||
/// Initializes a new instance of the <see cref="NLogger" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
public NLogger(string name)
|
||||
/// <param name="logManager">The log manager.</param>
|
||||
public NLogger(string name, ILogManager logManager)
|
||||
{
|
||||
_logManager = logManager;
|
||||
lock (LockObject)
|
||||
{
|
||||
_logger = NLog.LogManager.GetLogger(name);
|
||||
@@ -96,6 +100,13 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||
|
||||
var messageText = LogHelper.GetLogMessage(exception);
|
||||
|
||||
var prefix = _logManager.ExceptionMessagePrefix;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(prefix))
|
||||
{
|
||||
messageText.Insert(0, prefix);
|
||||
}
|
||||
|
||||
LogMultiline(message, level, messageText);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user