public static bool WriteEntry(string source, string message, EventEntryTypes type, string data, [Optional] string category, [Optional] string userName, [Optional] string machineName) { var entry = new EventEntry() { Source = source, Message = message, EntryType = type, Data = data, Category = category, UserName = userName, MachineName = machineName }; return(WriteEntry(entry)); }
private void btnRegister_Click(object sender, System.EventArgs e) { var src = ""; EventEntryTypes type = EventEntryTypes.Error; if (rdbError.Checked) { src = "InfiniteRetentionPeriod"; type = EventEntryTypes.Error; } else if (rdbWarning.Checked) { src = "FiveMinutes"; type = EventEntryTypes.Warning; } else if (rdbInformation.Checked) { src = "OneHour"; type = EventEntryTypes.Information; } Logger.WriteEntry(src, txtMessage.Text, type); }
public static bool WriteEntry(string source, string message, EventEntryTypes type, string data) { return(WriteEntry(source, message, type, data, category: null)); }
public static bool WriteEntry(string source, string message, EventEntryTypes type) { return(WriteEntry(source, message, type, null)); }