public static void Log(LogEntryType type, LogActionType action, string log, string metadata) { WriteLog($"LogEntryType: {type}\n" + $"LogActionType : {action}\n" + $"Log : {log}\n" + $"Metadata : {metadata}"); }
public async Task Append(int employeeId, LogActionType actionType, LogResourceType resourceType, int resourceId, string message, string oldValue = null, string newValue = null) { var logEntry = new AuditLogEntry(employeeId, actionType, resourceType, resourceId, message, oldValue, newValue); _dbContext.AuditLog.Add(logEntry); await _dbContext.SaveChangesAsync(); }
public LogFilter(string actionName, string menuName, LogActionType logActionType, string description = "") { Log = new LogModel() { ActionName = actionName, MenuName = menuName, ActionType = logActionType.ToString(), Description = description }; }
public int LogCount(EntityType type, LogActionType action, DateTime?start, DateTime?end) { IQueryable <ActionOnLogData> query = dbSet.Where(log => log.ActionType == action && log.EntityType == type); if (start.HasValue && end.HasValue && end.Value > DateTime.MinValue) { query = query.Where(log => log.DateTime > start.Value && log.DateTime < end.Value); } return(query.GroupBy(log => log.EntityId).Count()); }
public static void Log(LogEntryType type, LogActionType action, string log, string metadata) { if (WriteInConsole) ConsoleLogger.Log(type, action, log, metadata); if (WriteInDiagnostics) DiagnosticLogger.Log(type, action, log, metadata); if (WriteInDb) DbLog.Log(type, action, log, metadata); if (WriteInFile) FileLogger.Log(type, action, log, metadata, LogFilePath); }
public AuditLogEntry(int employeeId, LogActionType actionType, LogResourceType resourceType, int resourceId, string message, string oldValue = null, string newValue = null) { EmployeeId = employeeId; ActionType = actionType; ResourceType = resourceType; ResourceId = resourceId; Message = message; Timestamp = DateTime.Now; OldValue = oldValue; NewValue = newValue; }
public RepositoryPagingResponse <LeadMusicLog> GetMusicLogByAction(LogActionType action, DateTime start, DateTime end, int skip, int take) { RepositoryPagingResponse <LeadMusicLog> res = new RepositoryPagingResponse <LeadMusicLog>(); string queryString = null; queryString = String.Format(queryLeadMusicFormat, (int)action, start.ToString("yyyy-MM-dd HH:mm:ss"), end.ToString("yyyy-MM-dd HH:mm:ss")); var query = ((PaskolDbContext)_uow.context).Database.SqlQuery <LeadMusicLog>(queryString); res.TotalResults = query.Count(); res.Entities = query.OrderByDescending(l => l.Count).Skip(skip).Take(take); return(res); }
/// <summary> /// Adds and item to the log. /// </summary> /// <param name="ActionType">Type of action which this log pretains to.</param> /// <param name="ParamObject">Objects containing information needed to generate a message.</param> public void AddItem(LogActionType ActionType, params object[] ParamObject) { string LogMessage = string.Empty; switch (ActionType) { case LogActionType.Information: if (ParamObject[0].GetType() == typeof(string)) { LogMessage = ParamObject[0].ToString(); } break; case LogActionType.ShoeShuffle: if (ParamObject[0].GetType() == typeof(ShoeViewModel)) { ShoeViewModel tempShoe = (ShoeViewModel)ParamObject[0]; LogMessage = string.Format("Shuffled {0} deck shoe (Mode: {1}).", m_MasterParent.HouseRulesVM.DecksInShoe, m_MasterParent.HouseRulesVM.ShuffleMode.ToString()); } break; case LogActionType.Benchmark: if (ParamObject[0].GetType() == typeof(BenchmarkResults)) { BenchmarkResults tempResults = (BenchmarkResults)ParamObject[0]; LogMessage = string.Format("Benchmark \"{0}\" Finished: {1}/sec", tempResults.Name, tempResults.IterationsPerSecond.ToString()); } break; } LogItem tempLI = new LogItem(); tempLI.Type = ActionType; tempLI.Message = LogMessage; tempLI.Time = DateTime.Now; LogItems.Add(tempLI); if (!m_MasterParent.HouseRulesVM.FastMode) { OnPropertyChanged("Log"); } }
internal static string GetActionLogEnumDescription(LogActionType type) => type.AsString(EnumFormat.Description);
public static void Log(LogEntryType type, LogActionType action, string log) { WriteLog($"LogEntryType: {type}\n" + $"LogActionType : {action}\n" + $"Log : {log}\n"); }
/// <summary> /// Gell all /// </summary> /// <returns></returns> public static Expression <Func <ActionLog, bool> > WithActionTypeAct(LogActionType actionType) { return(al => al.ActionType == (byte)actionType); }
public static void Log(LogEntryType type, LogActionType action, string log, string metadata, string filePath) { throw new NotImplementedException(); }