public static ILogManager AddConsole(this ILogManager logManager, LogLevel minLevel) { if (logManager == null) { throw new ArgumentNullException(nameof(logManager)); } logManager.Add(new ConsoleLoggerFactory(minLevel)); return(logManager); }
public void Logging(LogDetail log) { if (log != null) { string _detail = JsonConvert.SerializeObject(log); Log _log = new Log() { ID = _logManager.CreateGuid(), DateTime = DateTime.Now, Detail = _detail }; _logManager.Add(_log); _logManager.Save(); } }
/// <summary> /// Add message to service log. /// </summary> /// <param name="message">The log message.</param> public void AddLog(string message) { logManager.Add(serviceId, message); }