Exemplo n.º 1
1
        public Application()
        {
            var fileName = Path.Combine(Directory.GetCurrentDirectory(), @"..\Live\SQLiteLogger.db");
            var connectionString = string.Format("Data Source={0};Version=3;", fileName);

            if (File.Exists(fileName))
                File.Delete(fileName);

            SQLiteConnection.CreateFile(fileName);
            _connection = new SQLiteConnection(connectionString);
            _connection.Open();

            Console.WriteLine("Logging to {0}", fileName);
            _hierarchy = (Hierarchy)LogManager.GetRepository();

            _appender = new SqLiteAppender(_connection);
            _hierarchy.Root.AddAppender(_appender);

            _hierarchy.Root.Level = Level.Debug;
            _hierarchy.Configured = true;
        }
Exemplo n.º 2
0
        public Application()
        {
            var fileName         = Path.Combine(Directory.GetCurrentDirectory(), @"..\Live\SQLiteLogger.db");
            var connectionString = string.Format("Data Source={0};Version=3;", fileName);

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            SQLiteConnection.CreateFile(fileName);
            _connection = new SQLiteConnection(connectionString);
            _connection.Open();

            Console.WriteLine("Logging to {0}", fileName);
            _hierarchy = (Hierarchy)LogManager.GetRepository();

            _appender = new SqLiteAppender(_connection);
            _hierarchy.Root.AddAppender(_appender);

            _hierarchy.Root.Level = Level.Debug;
            _hierarchy.Configured = true;
        }