litestream-ruby icon indicating copy to clipboard operation
litestream-ruby copied to clipboard

Logging output

Open nickpoorman opened this issue 5 months ago • 0 comments

Thoughts on supporting customization of the log ouput? As you can see from the following, I don't really have a great way to say grep the lines that are only for litestream. Something like the following would allow us to customize it.

module Litestream
  # ...
  DEFAULT_LOGGER = ActiveSupport::Logger.new($stdout)
  mattr_accessor :logger, default: DEFAULT_LOGGER
  # ...
I, [2024-09-17T23:13:18.832702 #47]  INFO -- : SolidQueue-1.0.0.beta Started Worker (69.7ms)  pid: 47, hostname: "e5f4024baddd", process_id: 8, name: "worker-1ec15b67ba1104316e4c", polling_interval: 0.1, queues: "*", thread_pool_size: 3
D, [2024-09-17T23:13:18.835364 #50] DEBUG -- :   SolidQueue::RecurringTask Upsert (8.1ms)  INSERT INTO "solid_queue_recurring_tasks" ("key","schedule","command","class_name","arguments","queue_name","priority","static","description","created_at","updated_at") VALUES ('periodic_litestream_backup_verfication_job', 'every day at 1am EST', NULL, 'Litestream::VerifyBackupJob', NULL, NULL, NULL, 1, NULL, STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW'), STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')) ON CONFLICT ("key") DO UPDATE SET updated_at=(CASE WHEN ("schedule" IS excluded."schedule" AND "command" IS excluded."command" AND "class_name" IS excluded."class_name" AND "arguments" IS excluded."arguments" AND "queue_name" IS excluded."queue_name" AND "priority" IS excluded."priority" AND "static" IS excluded."static" AND "description" IS excluded."description") THEN "solid_queue_recurring_tasks".updated_at ELSE STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') END),"schedule"=excluded."schedule","command"=excluded."command","class_name"=excluded."class_name","arguments"=excluded."arguments","queue_name"=excluded."queue_name","priority"=excluded."priority","static"=excluded."static","description"=excluded."description" RETURNING "id"
D, [2024-09-17T23:13:18.830489 #44] DEBUG -- :   SolidQueue::Semaphore Pluck (0.4ms)  SELECT "solid_queue_semaphores"."id" FROM "solid_queue_semaphores" WHERE "solid_queue_semaphores"."expires_at" < ? ORDER BY "solid_queue_semaphores"."id" ASC LIMIT ?  [["expires_at", "2024-09-17 23:13:18.819865"], ["LIMIT", 500]]
D, [2024-09-17T23:13:18.842138 #50] DEBUG -- :   SolidQueue::RecurringTask Load (1.2ms)  SELECT "solid_queue_recurring_tasks".* FROM "solid_queue_recurring_tasks" WHERE "solid_queue_recurring_tasks"."key" = ?  [["key", "periodic_litestream_backup_verfication_job"]]
I, [2024-09-17T23:13:18.851683 #50]  INFO -- : SolidQueue-1.0.0.beta Started Scheduler (88.3ms)  pid: 50, hostname: "e5f4024baddd", process_id: 7, name: "scheduler-2c72d7e5b3e90f0fa97e", recurring_schedule: ["periodic_litestream_backup_verfication_job"]
D, [2024-09-17T23:13:18.857439 #44] DEBUG -- :   SolidQueue::BlockedExecution Pluck (0.1ms)  SELECT DISTINCT "solid_queue_blocked_executions"."concurrency_key" FROM "solid_queue_blocked_executions" WHERE "solid_queue_blocked_executions"."expires_at" < ? LIMIT ?  [["expires_at", "2024-09-17 23:13:18.853877"], ["LIMIT", 500]]
D, [2024-09-17T23:13:18.857655 #44] DEBUG -- : SolidQueue-1.0.0.beta Unblock jobs (4.1ms)  limit: 500, size: 0
time=2024-09-17T23:13:19.733Z level=INFO msg="sync: new generation" db=/rails/storage/production_primary.sqlite3 generation=ff210e2edd84a21c reason="no generation exists"
time=2024-09-17T23:13:20.876Z level=INFO msg="write snapshot" db=/rails/storage/production_primary.sqlite3 replica=s3 position=ff210e2edd84a21c/00000002:4152
time=2024-09-17T23:13:21.589Z level=INFO msg="snapshot written" db=/rails/storage/production_primary.sqlite3 replica=s3 position=ff210e2edd84a21c/00000002:4152 elapsed=712.530584ms sz=4334
time=2024-09-17T23:13:22.189Z level=INFO msg="write wal segment" db=/rails/storage/production_primary.sqlite3 replica=s3 position=ff210e2edd84a21c/00000002:0
time=2024-09-17T23:13:22.881Z level=INFO msg="wal segment written" db=/rails/storage/production_primary.sqlite3 replica=s3 position=ff210e2edd84a21c/00000002:0 elapsed=692.3425ms sz=4152

nickpoorman avatar Sep 17 '24 23:09 nickpoorman