Exemplo n.º 1
0
        public void WriteTo(LogEntry logEntry)
        {
            IWriteTo ObjIntrface = null;

            ObjIntrface = WriteToFactory.GetObject(LoggSession.WriteTo);

            ObjIntrface.WriteTo(logEntry);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
        }