protected override void OnStart(string[] args) { auditor = new SqlAuditor(Config.AuditConfig.Load("Config.xml")); auditor.RegisterObserver(new GenericTraceObserverFactory((context) => new DBLogger())); auditor.RegisterObserver(new GenericTraceObserverFactory((context) => new EmailProvider())); auditor.Start(); // auditor.WaitAll(); }
static void Main(string[] args) { System.Console.CancelKeyPress += Console_CancelKeyPress; Console.WriteLine("SqlAuditor: Reading Config..."); var config = AuditConfig.Load("Config.xml"); auditor = new SqlAuditor(config); Console.WriteLine("SqlAuditor: Registering Observers..."); auditor.RegisterObserver(new GenericTraceObserverFactory((context) => new ConsoleTrace())); auditor.RegisterObserver(new GenericTraceObserverFactory((context) => new DBLogger())); auditor.Start(); Console.WriteLine("SqlAuditor: Started."); Console.WriteLine("Press CTR+C to exit."); auditor.WaitAll(); }