/// <summary> /// Responsible for converting exceptions into <seealso cref="IExceptionEntry"/> object, /// gets the entry empty object and passes to <seealso cref="FormatException(System.Exception, Tavisca.Frameworks.Logging.IExceptionEntry)"/> /// The method calls <seealso cref="FormatException(Tavisca.Frameworks.Logging.IExceptionEntry)"/> at the end for /// final formatting, override this method only to change how an exception is converted to an entry. /// </summary> /// <param name="exception">The exception entry to be converted.</param> /// <returns>An <see cref="IExceptionEntry"/> object.</returns> public virtual IExceptionEntry FormatException(Exception exception) { if (exception == null) { throw new ArgumentNullException("exception"); } var entry = LocatorProvider.GetContainer().GetInstance <IExceptionEntry>(); if (entry == null) { throw new LogConfigurationException("IExceptionEntry is not configured in the DI container."); } entry = FormatException(exception, entry); return(FormatException(entry)); }
protected virtual ILogEntry GetLogEntry() { return(LocatorProvider.GetContainer().GetInstance <ITransactionEntry>()); }
protected virtual ITraceLogger GetTraceLogFactory() { return(LocatorProvider.GetContainer().GetInstance <ITraceLogger>()); }
/// <summary> /// Gets an <see cref="ISink"/> by name using the DI container configured in the system. /// </summary> /// <param name="name">The name (key) of the logger.</param> /// <returns>An instance of an <see cref="ISink"/></returns> protected virtual ISink GetLoggerByName(string name) { return(LocatorProvider.GetContainer().GetInstance <ISink>(name)); }
protected virtual IExceptionEntry GetEmptyExceptionEntry() { return(LocatorProvider.GetContainer().GetInstance <IExceptionEntry>()); }
protected virtual IEntryStringTranslator GetTranslator() { return(LocatorProvider.GetContainer().GetInstance <IEntryStringTranslator>()); }