///////////////////////////////////////////////////////////////////////////////
// Example console output from running example/any_logger_mysql_example.dart //
///////////////////////////////////////////////////////////////////////////////
MySQL Appender Configuration Examples

==================================================

### Example 1: Basic Configuration ###

Basic config:
  type: MYSQL
  host: localhost
  port: 3306
  database: app_logs
  user: logger
  password: ******
  table: logs
  level: INFO
  batchSize: 50
  batchIntervalSeconds: 10

SSL config:
  type: MYSQL
  host: secure-db.example.com
  port: 3306
  database: production
  user: app_user
  password: ******
  useSSL: true
  connectionTimeout: 60
  level: WARN

### Example 2: Table Configuration ###

Custom table configuration:
  type: MYSQL
  host: localhost
  database: analytics
  table: events
  autoCreateTable: true
  tableEngine: InnoDB
  charset: utf8mb4
  useCompression: true
  customFields:
    user_id: VARCHAR(100)
    event_type: VARCHAR(50)
    event_data: JSON
    ip_address: VARCHAR(45)
    duration_ms: INT
    cost: DECIMAL(10,2)
  createIndices: true
  indexColumns: timestamp, level, user_id, event_type

Audit table configuration:
  Table: audit_trail
  Engine: InnoDB
  Rotation: false
  Custom fields: user_id, action, resource, result, ip_address, session_id

### Example 3: Performance Configuration ###

High-volume configuration:
  type: MYSQL
  host: db-cluster.example.com
  database: logs
  table: high_volume
  batchSize: 500
  batchIntervalSeconds: 5
  usePreparedStatements: true
  useCompression: true
  maxReconnectAttempts: 5
  reconnectDelaySeconds: 2
  enableRotation: true
  maxRows: 10000000
  rotationCheckInterval: 3600
  archiveTablePrefix: archive_
  createIndices: true
  indexColumns: timestamp, level

Development configuration:
  type: MYSQL
  host: localhost
  database: dev_logs
  table: debug
  batchSize: 1
  batchIntervalSeconds: 1
  autoCreateTable: true
  createIndices: true
  indexColumns: timestamp, level, tag, logger_name, class_name
  level: DEBUG

### Example 4: Builder Pattern ###

Built appender with:
  Host: localhost:3306
  Database: myapp
  Table: logs
  Level: INFO
  Batch size: 100
  Rotation enabled: true

Production preset appender:
  Batch size: 100
  Reconnect attempts: 5
  Rotation enabled: true
  Max rows: 10000000

Audit preset appender:
  Table: audit_trail
  Custom fields: user_id, action, ip_address, user_agent
  Rotation: false

### Example 5: LoggerFactory Integration ###

LoggerFactory configuration:
  Appenders: 2
    1. Type: CONSOLE, Level: INFO
    2. Type: MYSQL, Level: INFO

Logger configured with 2 appenders:
  - CONSOLE (Level: INFO)
  - MYSQL (Level: INFO)

Using LoggerBuilder:
Builder created 2 appenders

Using production preset with MySQL:
Production preset created 2 appenders

### Example 6: Query API Examples ###

Query API examples:

// Query last 100 errors:
final errors = await appender.queryLogs(
  minLevel: Level.ERROR,
  limit: 100,
);

// Query logs from last hour:
final recent = await appender.queryLogs(
  startTime: DateTime.now().subtract(Duration(hours: 1)),
  orderBy: "timestamp DESC",
);

// Query by tag and logger:
final tagged = await appender.queryLogs(
  tag: "PAYMENT",
  loggerName: "PaymentService",
  limit: 50,
);

// Query with pagination:
final page2 = await appender.queryLogs(
  limit: 20,
  offset: 20,
  orderBy: "timestamp DESC",
);

// Complex query:
final complex = await appender.queryLogs(
  minLevel: Level.WARN,
  startTime: DateTime.now().subtract(Duration(days: 7)),
  endTime: DateTime.now(),
  tag: "API",
  limit: 1000,
);

==================================================
Examples completed (no actual database connections made)

Process finished with exit code 0
