public void WriteTo(LogEntry logEntry) { IWriteTo ObjIntrface = null; ObjIntrface = WriteToFactory.GetObject(LoggSession.WriteTo); ObjIntrface.WriteTo(logEntry); }
public void WriteTo(LogEntry logEntry) { logEntry.Id = logEntries.Count + 1; logEntries.Add(logEntry); string serializeXml = String.Empty; //serialize xml Serialization.Serialize<Logg.LogEntries>(logEntries, ref serializeXml); XDocument.Parse(serializeXml).Save(SerializeTo); }
public LogEntry GetLogEntry(string message, LogEntryType type) { logEntry = new LogEntry( System.Security.Principal.WindowsIdentity.GetCurrent().Name , String.Format("Assembly: {0}, Module: {1}, Method: {2}" , TraceContext.methodBase.DeclaringType.Assembly.GetName().Name , TraceContext.methodBase.DeclaringType.FullName , TraceContext.methodBase.Name) , message , type , DateTime.Now); return logEntry; }