/// <summary> /// /// </summary> /// <param name="data"></param> public void LogEvent(ProcessTraceData data) { //--------- // Filter event data // Not written yet.. //---------- //----------------- // Log Process/Stop/Start event //using (EventLogWriter writer = new EventLogWriter(_processLogName)) //{ // LogRow text = new LogRow(); // text.Add(data.TimeStamp.ToString()); // text.Add(data.EventName); // text.Add(data.ProcessID.ToString()); // text.Add(data.ProcessName); // text.Add(data.CommandLine); // text.Add(data.ImageFileName); // writer.WriteRow(text); //} LogRow text = new LogRow(); _processWriter.WriteHeader(data, text); text.Add(data.CommandLine); text.Add(data.ImageFileName); _processWriter.WriteRow(text); }
public void WriteHeader(TraceEvent data, LogRow header) { header.Add(data.TimeStamp.ToString()); header.Add(data.EventName); header.Add(data.ProcessID.ToString()); header.Add(data.ProcessName); }
/// <summary> /// /// </summary> /// <param name="data"></param> public void LogEvent(ImageLoadTraceData data) { //--------- // Filter event data // Not written yet.. //---------- //--------------- // Log ImageLoad event //Stream log = File.Open(_imageLogName, FileMode.Append, FileAccess.ReadWrite); //using (EventLogWriter writer = new EventLogWriter(_imageLogName)) //{ // LogRow text = new LogRow(); // text.Add(data.TimeStamp.ToString()); // text.Add(data.EventName); // text.Add(data.ProcessID.ToString()); // text.Add(data.ProcessName); // text.Add(data.FileName); // writer.WriteRow(text); //} //------------------ LogRow text = new LogRow(); _imageWriter.WriteHeader(data, text); text.Add(data.FileName); _imageWriter.WriteRow(text); }
public void WriteRow(LogRow row) { StringBuilder builder = new StringBuilder(); bool isFirstCol = true; foreach (string field in row) { if (!isFirstCol) { builder.Append(','); } if (field.IndexOfAny(new char[] { '"', ',' }) != -1) { builder.AppendFormat("\"{0}\"", field.Replace("\"", "\"\"")); } else { builder.Append(field); } isFirstCol = false; } row.rowText = builder.ToString(); WriteLine(row.rowText); }
public void LogEvent(FileIOInfoTraceData data) { #region Comments //LogEvent((FileIOCreateTraceData)data); //--------- // Filter event data // Not written yet.. //---------- //--------------- // Log ImageLoad event //using (EventLogWriter writer = new EventLogWriter(_fileIOLogName)) //{ // LogRow text = new LogRow(); // text.Add(data.TimeStamp.ToString()); // text.Add(data.EventName); // text.Add(data.ProcessID.ToString()); // text.Add(data.ProcessName); // text.Add(data.FileName); // writer.WriteRow(text); //} //------------------ #endregion LogRow text = new LogRow(); _fileIOWriter.WriteHeader(data, text); text.Add(data.FileName); _fileIOWriter.WriteRow(text); }
public void LogEvent(RegistryTraceData data) { LogRow text = new LogRow(); _registryWriter.WriteHeader(data, text); text.Add(data.KeyName); text.Add(data.ValueName); _registryWriter.WriteRow(text); }
public void LogEvent(UdpIpTraceData data) { LogRow text = new LogRow(); _netWriter.WriteHeader(data, text); text.Add(data.saddr.ToString()); text.Add(data.sport.ToString()); text.Add(data.daddr.ToString()); text.Add(data.dport.ToString()); _netWriter.WriteRow(text); }
public void LogEvent(FileIOReadWriteTraceData data) { //--------- // Filter event data // Not written yet.. //---------- //--------------- // Log ImageLoad event LogRow text = new LogRow(); _fileIOWriter.WriteHeader(data, text); text.Add(data.FileName); _fileIOWriter.WriteRow(text); //------------------ }