Ejemplo n.º 1
0
        /// <summary>
        /// Write an auditmessage to the audit file.
        /// </summary>
        protected override void WriteAuditMessage(AuditMessage auditMessage)
        {
            using (var command = new SQLiteCommand(m_connection))
            {
                command.CommandText = @"INSERT INTO Audit
                                       (TIMESTAMP,USER,ACCOUNT,INCOMING_REQUEST,OUTGOING_REQUEST,DURATION)
                                       VALUES (?,?,?,?,?,?)
                                      ";
                command.Parameters.Add(new SQLiteParameter("TimeStamp", auditMessage.AuditTime));
                command.Parameters.Add(new SQLiteParameter("USER", auditMessage.User));
                command.Parameters.Add(new SQLiteParameter("ACCOUNT", auditMessage.Account));
                command.Parameters.Add(new SQLiteParameter("INCOMING_REQUEST", auditMessage.IncomingChannel));
                command.Parameters.Add(new SQLiteParameter("OUTGOING_REQUEST", auditMessage.OutgoingChannel));
                command.Parameters.Add(new SQLiteParameter("DURATION", auditMessage.DurationMS));

                command.ExecuteNonQuery();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Write an auditmessage to the audit file.
        /// </summary>
        protected override void WriteAuditMessage(AuditMessage auditMessage)
        {
            var outstr = $"{auditMessage.AuditTime},{auditMessage.User},{auditMessage.Account},{auditMessage.IncomingChannel},{auditMessage.OutgoingChannel},{auditMessage.DurationMS}";

            File.AppendAllLines(m_fileName, new[] { outstr });
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Log an incoming message.
 /// </summary>
 public void LogIncomingMessage(string requestID, string user, string account, string channel, string payload)
 {
     m_messageLookup[requestID] = new AuditMessage {
         User = user, Account = account, IncomingChannel = channel, AuditTime = DateTime.UtcNow
     };
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Write audit message to storage.
 /// </summary>
 protected abstract void WriteAuditMessage(AuditMessage auditMessage);