diff options
| author | Luke <luke.pulverenti@gmail.com> | 2014-12-17 17:42:31 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2014-12-17 17:42:31 -0500 |
| commit | a7f2bc5fda526e227e0dbdd23e0d408ed627da14 (patch) | |
| tree | 9d3ca8e950bc8a0aae88fad7005971ec937f9e5a /MediaBrowser.Common.Implementations/Logging/NLogger.cs | |
| parent | 999f2e03f4cbd70bb5f253fd7d4c9bc11bf9c963 (diff) | |
| parent | e3484bdcc204ae39e0bfdf08e758012a048d539c (diff) | |
Merge pull request #956 from MediaBrowser/dev
3.0.5464.40000
Diffstat (limited to 'MediaBrowser.Common.Implementations/Logging/NLogger.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/Logging/NLogger.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/MediaBrowser.Common.Implementations/Logging/NLogger.cs b/MediaBrowser.Common.Implementations/Logging/NLogger.cs index c87b58f70..29b618890 100644 --- a/MediaBrowser.Common.Implementations/Logging/NLogger.cs +++ b/MediaBrowser.Common.Implementations/Logging/NLogger.cs @@ -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); } |
