Remove exception logging and finish LogWarning
This commit is contained in:
@@ -297,7 +297,7 @@ namespace Umbraco.Core.Composing
|
||||
}
|
||||
catch (TypeLoadException ex)
|
||||
{
|
||||
_logger.LogError(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly);
|
||||
_logger.LogError(ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace Umbraco.Core.Composing
|
||||
}
|
||||
catch (TypeLoadException ex)
|
||||
{
|
||||
_logger.LogError(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly);
|
||||
_logger.LogError(ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ namespace Umbraco.Core.Composing
|
||||
if (_notifiedLoadExceptionAssemblies.Contains(a.FullName) == false)
|
||||
{
|
||||
_notifiedLoadExceptionAssemblies.Add(a.FullName);
|
||||
_logger.LogWarning(typeof (TypeFinder), ex, "Could not load all types from {TypeName}.", a.GetName().Name);
|
||||
_logger.LogWarning(ex, "Could not load all types from {TypeName}.", a.GetName().Name);
|
||||
}
|
||||
}
|
||||
return rex.Types.WhereNotNull().ToArray();
|
||||
|
||||
@@ -31,53 +31,31 @@ namespace Umbraco.Core.Logging
|
||||
Console.WriteLine("FATAL {0} - {1}", typeof(T).Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string message)
|
||||
{
|
||||
Console.WriteLine("ERROR {0} - {1}", reporting.Name, message);
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception)
|
||||
{
|
||||
Console.WriteLine("ERROR {0}", reporting.Name);
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, string message)
|
||||
public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("ERROR {0} - {1}", reporting.Name, message);
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
Console.WriteLine("ERROR {0} - {1}", typeof(T).Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
public void LogError(string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("ERROR {0} - {1}", reporting.Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
Console.WriteLine("ERROR {0} - {1}", typeof(T).Name, _messageTemplates.Render(messageTemplate, propertyValues));
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, string message)
|
||||
public void LogWarning(string message, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, message);
|
||||
Console.WriteLine("WARN {0} - {1}", typeof(T).Name, _messageTemplates.Render(message, propertyValues));
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, string message, params object[] propertyValues)
|
||||
public void LogWarning(Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues));
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, message);
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
Console.WriteLine("WARN {0} - {1}", reporting.Name, _messageTemplates.Render(message, propertyValues));
|
||||
Console.WriteLine("WARN {0} - {1}", typeof(T).Name, _messageTemplates.Render(message, propertyValues));
|
||||
Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,6 @@ namespace Umbraco.Core.Logging
|
||||
System.Diagnostics.Debug.WriteLine(messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception, string message)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception)
|
||||
{
|
||||
@@ -48,45 +42,27 @@ namespace Umbraco.Core.Logging
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, string message)
|
||||
public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message);
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(messageTemplate, propertyValues) + Environment.NewLine + exception, typeof(T).FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(messageTemplate, propertyValues) + Environment.NewLine + exception, reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
public void LogError(string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, string message)
|
||||
public void LogWarning(string message, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message, reporting.FullName);
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message, propertyValues), typeof(T).FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, string message, params object[] propertyValues)
|
||||
public void LogWarning(Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message, propertyValues), reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, Exception exception, string message, params object[] propertyValues)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message + Environment.NewLine + exception, propertyValues), reporting.FullName);
|
||||
System.Diagnostics.Debug.WriteLine(_messageTemplates.Render(message + Environment.NewLine + exception, propertyValues), typeof(T).FullName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Umbraco.Core.Logging
|
||||
{
|
||||
if (_failed)
|
||||
{
|
||||
_logger.LogError(_loggerType, _failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId);
|
||||
_logger.LogError(_failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId);
|
||||
}
|
||||
else switch (_level)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Umbraco.Core.Logging
|
||||
{
|
||||
|
||||
public interface ILogger : ILogger<object>{}
|
||||
public interface ILogger : ILogger<object> { }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the logging service.
|
||||
@@ -24,14 +24,6 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="level">The level.</param>
|
||||
bool IsEnabled(Type reporting, LogLevel level);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a fatal exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <remarks>The message string is unspecified and is implementation-specific.</remarks>
|
||||
void Fatal(Type reporting, Exception exception);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a fatal message with an exception.
|
||||
/// </summary>
|
||||
@@ -50,74 +42,32 @@ namespace Umbraco.Core.Logging
|
||||
/// <summary>
|
||||
/// Logs an error message with an exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void LogError(Type reporting, Exception exception, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <remarks>The message string is unspecified and is implementation-specific.</remarks>
|
||||
void LogError(Type reporting, Exception exception);
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void LogError(Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void LogError(Type reporting, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message with an exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void LogError(Type reporting, string messageTemplate, params object[] propertyValues);
|
||||
void LogError(string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void LogWarning(Type reporting, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues);
|
||||
void LogWarning(string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
void LogWarning(Type reporting, Exception exception, string message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
/// </summary>
|
||||
/// <param name="reporting">The reporting type.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an information message.
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="message">A message.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
public static void LogError<T>(this ILogger logger, Exception exception, string message)
|
||||
=> logger.LogError(typeof(T), exception, message);
|
||||
=> logger.LogError(exception, message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message with an exception.
|
||||
@@ -35,16 +35,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void LogError<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogError(typeof(T), exception, messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error exception.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The reporting type.</typeparam>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="exception">An exception.</param>
|
||||
public static void LogError<T>(this ILogger logger, Exception exception)
|
||||
=> logger.LogError(typeof(T), exception);
|
||||
=> logger.LogError(exception, messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message.
|
||||
@@ -53,7 +44,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void LogError<T>(this ILogger logger, string message)
|
||||
=> logger.LogError(typeof(T), message);
|
||||
=> logger.LogError(message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an error message.
|
||||
@@ -63,7 +54,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void LogError<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogError(typeof(T), messageTemplate, propertyValues);
|
||||
=> logger.LogError(messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
@@ -72,7 +63,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void LogWarning<T>(this ILogger logger, string message)
|
||||
=> logger.LogWarning(typeof(T), message);
|
||||
=> logger.LogWarning(message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message.
|
||||
@@ -82,7 +73,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void LogWarning<T>(this ILogger logger, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogWarning(typeof(T), messageTemplate, propertyValues);
|
||||
=> logger.LogWarning(messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -92,7 +83,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void LogWarning<T>(this ILogger logger, Exception exception, string message)
|
||||
=> logger.LogWarning(typeof(T), exception, message);
|
||||
=> logger.LogWarning(exception, message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a warning message with an exception.
|
||||
@@ -103,7 +94,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="messageTemplate">A message template.</param>
|
||||
/// <param name="propertyValues">Property values.</param>
|
||||
public static void LogWarning<T>(this ILogger logger, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> logger.LogWarning(typeof(T), exception, messageTemplate, propertyValues);
|
||||
=> logger.LogWarning(exception, messageTemplate, propertyValues);
|
||||
|
||||
/// <summary>
|
||||
/// Logs an information message.
|
||||
@@ -170,7 +161,7 @@ namespace Umbraco.Core.Logging
|
||||
/// <param name="exception">An exception.</param>
|
||||
/// <param name="message">A message.</param>
|
||||
public static void Fatal<T>(this ILogger logger, Exception exception, string message)
|
||||
=> logger.LogCritical(exception, message, new object[] { });
|
||||
=> logger.LogCritical(exception, message);
|
||||
|
||||
/// <summary>
|
||||
/// Logs a fatal message.
|
||||
|
||||
@@ -21,47 +21,27 @@ namespace Umbraco.Core.Logging
|
||||
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, string message)
|
||||
public void LogError(string message, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
public void LogWarning(string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, string message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
public void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -67,41 +67,23 @@ namespace Umbraco.Core.Logging
|
||||
public bool IsEnabled(Type reporting, LogLevel level)
|
||||
=> Logger.IsEnabled(reporting, level);
|
||||
|
||||
public void Fatal(Type reporting, Exception exception)
|
||||
=> Logger.Fatal(reporting, exception);
|
||||
|
||||
public void LogCritical(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogCritical(exception, messageTemplate, propertyValues);
|
||||
|
||||
public void LogCritical(string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogCritical(messageTemplate, propertyValues);
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string message)
|
||||
=> Logger.LogError(reporting, exception, message);
|
||||
public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogError(exception, messageTemplate, propertyValues);
|
||||
|
||||
public void LogError(Type reporting, Exception exception)
|
||||
=> Logger.LogError(reporting, exception);
|
||||
public void LogError(string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogError(messageTemplate, propertyValues);
|
||||
|
||||
public void LogError(Type reporting, string message)
|
||||
=> Logger.LogError(reporting, message);
|
||||
public void LogWarning(string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(messageTemplate, propertyValues);
|
||||
|
||||
public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogError(reporting, exception, messageTemplate, propertyValues);
|
||||
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogError(reporting, messageTemplate, propertyValues);
|
||||
|
||||
public void LogWarning(Type reporting, string message)
|
||||
=> Logger.LogWarning(reporting, message);
|
||||
|
||||
public void LogWarning(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(reporting, messageTemplate, propertyValues);
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
=> Logger.LogWarning(reporting, exception, message);
|
||||
|
||||
public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(reporting, exception, messageTemplate, propertyValues);
|
||||
public void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
=> Logger.LogWarning(exception, messageTemplate, propertyValues);
|
||||
|
||||
public void Info(Type reporting, string message)
|
||||
=> Logger.Info(reporting, message);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Examine
|
||||
}
|
||||
catch (AlreadyClosedException)
|
||||
{
|
||||
Logger.LogWarning(typeof(UmbracoContentIndex), "Cannot get GetIndexDocumentCount, the writer is already closed");
|
||||
Logger.LogWarning("Cannot get GetIndexDocumentCount, the writer is already closed");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace Umbraco.Examine
|
||||
}
|
||||
catch (AlreadyClosedException)
|
||||
{
|
||||
Logger.LogWarning(typeof(UmbracoContentIndex), "Cannot get GetIndexFieldCount, the writer is already closed");
|
||||
Logger.LogWarning("Cannot get GetIndexFieldCount, the writer is already closed");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Umbraco.Examine
|
||||
/// <param name="ex"></param>
|
||||
protected override void OnIndexingError(IndexingErrorEventArgs ex)
|
||||
{
|
||||
ProfilingLogger.LogError(GetType(), ex.InnerException, ex.Message);
|
||||
ProfilingLogger.LogError(ex.InnerException, ex.Message);
|
||||
base.OnIndexingError(ex);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Umbraco.Web.Compose
|
||||
user = _userService.GetUserById(Constants.Security.SuperUserId);
|
||||
if (user == null)
|
||||
{
|
||||
_logger.LogWarning(typeof(Notifier), "Notifications can not be sent, no admin user with id {SuperUserId} could be resolved", Constants.Security.SuperUserId);
|
||||
_logger.LogWarning("Notifications can not be sent, no admin user with id {SuperUserId} could be resolved", Constants.Security.SuperUserId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ namespace Umbraco.Web.Compose
|
||||
if (sender == null) throw new ArgumentNullException(nameof(sender));
|
||||
if (siteUri == null)
|
||||
{
|
||||
_logger.LogWarning(typeof(Notifier), "Notifications can not be sent, no site url is set (might be during boot process?)");
|
||||
_logger.LogWarning("Notifications can not be sent, no site url is set (might be during boot process?)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,14 +80,6 @@ namespace Umbraco.Core.Logging.Serilog
|
||||
public bool IsEnabled(Type reporting, LogLevel level)
|
||||
=> LoggerFor(reporting).IsEnabled(MapLevel(level));
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Fatal(Type reporting, Exception exception)
|
||||
{
|
||||
var logger = LoggerFor(reporting);
|
||||
var message = "Exception.";
|
||||
logger.Fatal(exception, message);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogCritical(string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
@@ -101,13 +93,6 @@ namespace Umbraco.Core.Logging.Serilog
|
||||
logger.Fatal(exception, messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception, string message)
|
||||
{
|
||||
var logger = LoggerFor(reporting);
|
||||
logger.Error(exception, message);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception)
|
||||
{
|
||||
@@ -117,46 +102,28 @@ namespace Umbraco.Core.Logging.Serilog
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, string message)
|
||||
public void LogError(string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
LoggerFor(reporting).Error(message);
|
||||
LoggerFor(typeof(T)).Error(messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, string messageTemplate, params object[] propertyValues)
|
||||
public void LogError(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
LoggerFor(reporting).Error(messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogError(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
var logger = LoggerFor(reporting);
|
||||
var logger = LoggerFor(typeof(T));
|
||||
logger.Error(exception, messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, string message)
|
||||
public void LogWarning(string message, params object[] propertyValues)
|
||||
{
|
||||
LoggerFor(reporting).Warning(message);
|
||||
LoggerFor(typeof(T)).Warning(message, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, string message, params object[] propertyValues)
|
||||
public void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
LoggerFor(reporting).Warning(message, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, Exception exception, string message)
|
||||
{
|
||||
LoggerFor(reporting).Warning(exception, message);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void LogWarning(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues)
|
||||
{
|
||||
LoggerFor(reporting).Warning(exception, messageTemplate, propertyValues);
|
||||
LoggerFor(typeof(T)).Warning(exception, messageTemplate, propertyValues);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Umbraco.Web.Media
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(typeof(UploadAutoFillProperties), ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath);
|
||||
_logger.LogError(ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath);
|
||||
ResetProperties(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
continue;
|
||||
}
|
||||
|
||||
Logger.LogWarning(GetType(), "Could not find PropertyData {PropertyDataId} value '{PropertyValue}' in the datatype configuration: {Values}.",
|
||||
Logger.LogWarning("Could not find PropertyData {PropertyDataId} value '{PropertyValue}' in the datatype configuration: {Values}.",
|
||||
propData.Id, id, string.Join(", ", config.Items.Select(x => x.Id + ":" + x.Value)));
|
||||
canConvert = false;
|
||||
}
|
||||
|
||||
@@ -210,8 +210,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
//fixme: Don't explode if we can't find this, log an error and change this to a label
|
||||
if (propertyEditor == null)
|
||||
{
|
||||
_logger.LogError(GetType(),
|
||||
"No property editor could be resolved with the alias: {PropertyEditorAlias}, defaulting to label", p.PropertyEditorAlias);
|
||||
_logger.LogError("No property editor could be resolved with the alias: {PropertyEditorAlias}, defaulting to label", p.PropertyEditorAlias);
|
||||
propertyEditorAlias = Constants.PropertyEditors.Aliases.Label;
|
||||
propertyEditor = _propertyEditors[propertyEditorAlias];
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Umbraco.Core.Models
|
||||
|
||||
if (entity.ValidatePath() == false)
|
||||
{
|
||||
logger.LogWarning(typeof(PathValidationExtensions), "The content item {EntityId} has an invalid path: {EntityPath} with parentID: {EntityParentId}", entity.Id, entity.Path, entity.ParentId);
|
||||
logger.LogWarning("The content item {EntityId} has an invalid path: {EntityPath} with parentID: {EntityParentId}", entity.Id, entity.Path, entity.ParentId);
|
||||
if (entity.ParentId == -1)
|
||||
{
|
||||
entity.Path = string.Concat("-1,", entity.Id);
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Current.Logger.LogWarning(typeof(PropertyTagsExtensions), ex, "Could not automatically convert stored json value to an enumerable string '{Json}'", value.ToString());
|
||||
Current.Logger.LogWarning(ex, "Could not automatically convert stored json value to an enumerable string '{Json}'", value.ToString());
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
// Check we have an editor for the data type.
|
||||
if (!editors.TryGet(dto.EditorAlias, out var editor))
|
||||
{
|
||||
logger.LogWarning(typeof(DataType), "Could not find an editor with alias {EditorAlias}, treating as Label. " +
|
||||
"The site may fail to boot and/or load data types and run.", dto.EditorAlias);
|
||||
logger.LogWarning("Could not find an editor with alias {EditorAlias}, treating as Label. " +
|
||||
"The site may fail to boot and/or load data types and run.", dto.EditorAlias);
|
||||
|
||||
// Create as special type, which downstream can be handled by converting to a LabelPropertyEditor to make clear
|
||||
// the situation to the user.
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(typeof(HtmlImageSourceParser), ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath);
|
||||
_logger.LogError(ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Umbraco.Core.Runtime
|
||||
}
|
||||
catch (TimeoutException ex)
|
||||
{
|
||||
_logger.LogError<MainDomSemaphoreLock>(ex);
|
||||
_logger.LogError<MainDomSemaphoreLock>(ex.Message);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(GetType(), ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId);
|
||||
_logger.LogError(ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId);
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse("Error creating dictionary item");
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(GetType(), ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId);
|
||||
_logger.LogError(ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId);
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse("Something went wrong saving dictionary");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(GetType(), ex, "Error creating relation type with {Name}", relationType.Name);
|
||||
_logger.LogError(ex, "Error creating relation type with {Name}", relationType.Name);
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse("Error creating relation type.");
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(GetType(), ex, "Error saving relation type with {Id}", relationType.Id);
|
||||
_logger.LogError(ex, "Error saving relation type with {Id}", relationType.Id);
|
||||
throw HttpResponseException.CreateNotificationValidationErrorResponse("Something went wrong when saving the relation type");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Umbraco.Extensions
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Current.Logger.LogError(typeof(ImageCropperTemplateExtensions), ex, "Could not parse the json string: {Json}", json);
|
||||
Current.Logger.LogError(ex, "Could not parse the json string: {Json}", json);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Umbraco.Web.Common.Install
|
||||
if (_reported && _reportedLevel == level) return;
|
||||
_reported = true;
|
||||
_reportedLevel = level;
|
||||
logger.LogWarning(typeof(UmbracoInstallApplicationBuilderExtensions), message);
|
||||
logger.LogWarning(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Web.Common.Middleware
|
||||
catch (Exception ex)
|
||||
{
|
||||
// try catch so we don't kill everything in all requests
|
||||
_logger.LogError<UmbracoRequestMiddleware>(ex);
|
||||
_logger.LogError<UmbracoRequestMiddleware>(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Umbraco.Web
|
||||
{
|
||||
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
|
||||
var message = $"{callerName} {lineNumber} : {text}";
|
||||
Current.Logger.LogError<T>(new ImageProcessingException(message));
|
||||
Current.Logger.LogError<T>(new ImageProcessingException(message).Message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -42,7 +42,7 @@ namespace Umbraco.Web
|
||||
{
|
||||
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
|
||||
var message = $"{callerName} {lineNumber} : {text}";
|
||||
Current.Logger.LogError(type, new ImageProcessingException(message));
|
||||
Current.Logger.LogError(new ImageProcessingException(message).Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace Umbraco.Web.Logging
|
||||
_logger.LogCritical(exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
return true;
|
||||
case TraceEventType.Error:
|
||||
_logger.LogError(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
_logger.LogError(exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
return true;
|
||||
case TraceEventType.Warning:
|
||||
_logger.LogWarning(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
_logger.LogWarning("[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
return true;
|
||||
case TraceEventType.Information:
|
||||
_logger.Info(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state);
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Umbraco.Web.Security
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Current.Logger.LogError(typeof (AuthenticationOptionsExtensions), ex, "Could not read AuthenticationOptions properties");
|
||||
Current.Logger.LogError(ex, "Could not read AuthenticationOptions properties");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -455,7 +455,7 @@ namespace Umbraco.Web
|
||||
}
|
||||
catch (Exception ex) when (ex is FormatException || ex is ArgumentException)
|
||||
{
|
||||
Current.Logger.LogWarning(typeof(UmbracoHelper), "A value was detected in the ufprt parameter but Umbraco could not decrypt the string");
|
||||
Current.Logger.LogWarning("A value was detected in the ufprt parameter but Umbraco could not decrypt the string");
|
||||
parts = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Web.WebApi.Filters
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Current.Logger.LogError(typeof(AngularAntiForgeryHelper), ex, "Could not validate XSRF token");
|
||||
Current.Logger.LogError(ex, "Could not validate XSRF token");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Umbraco.Web.WebApi
|
||||
var requestUrl = context.ExceptionContext?.ControllerContext?.Request?.RequestUri?.AbsoluteUri;
|
||||
var controllerType = context.ExceptionContext?.ActionContext?.ControllerContext?.Controller?.GetType();
|
||||
|
||||
_logger.LogError(controllerType, context.Exception, "Unhandled controller exception occurred for request '{RequestUrl}'", requestUrl);
|
||||
_logger.LogError(context.Exception, "Unhandled controller exception occurred for request '{RequestUrl}'", requestUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user