using System;
using System.Data.Common;

namespace EonaCat.Logger.EonaCatCoreLogger
{
    // This file is part of the EonaCat project(s) which is released under the Apache License.
    // See the LICENSE file or go to https://EonaCat.com/License for full license details.
    public class BatchingDatabaseLoggerOptions
    {
        public DbProviderFactory DbProviderFactory { get; set; }
        public string ConnectionString { get; set; }
        public string InsertCommand { get; set; } =
            @"INSERT INTO Logs (Timestamp, LogLevel, Category, Message, Exception, CorrelationId)
              VALUES (@Timestamp, @LogLevel, @Category, @Message, @Exception, @CorrelationId)";

        public bool IsEnabled { get; set; } = true;
        public bool IncludeCorrelationId { get; set; }
        public int BatchSize { get; set; } = 50;

        public TimeSpan BatchInterval { get; set; } = TimeSpan.FromSeconds(5); // 5 sec batch
        public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(10); // wait on shutdown
    }
}
