From 16b833d077147ec3c795003b8c37b4bf86a267ad Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 8 Feb 2026 11:07:45 -0600 Subject: [PATCH] fix: correct LoggerFileBackend API usage to fix Oban startup The previous commit (90e8964) introduced an incorrect LoggerBackends.add/2 call that prevented Oban from starting, causing all discovery jobs to remain stuck in "available" state without being processed. Root cause: LoggerBackends.add expects a tuple {module, id} as the first argument, not the module alone with configuration options. Fix: Use the correct API pattern: 1. Add backend with tuple identifier: {LoggerFileBackend, :file_log} 2. Configure separately with Logger.configure_backend/2 This resolves device discovery being completely broken - all background jobs (discovery, polling, monitoring) now process correctly. --- lib/towerops/application.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/towerops/application.ex b/lib/towerops/application.ex index 73a838cf..26b096eb 100644 --- a/lib/towerops/application.ex +++ b/lib/towerops/application.ex @@ -225,7 +225,11 @@ defmodule Towerops.Application do # Register file logger backend for development (only available in :dev environment) defp register_file_logger do if Code.ensure_loaded?(LoggerBackends) do - LoggerBackends.add(LoggerFileBackend, + # Add the backend with a unique identifier + LoggerBackends.add({LoggerFileBackend, :file_log}) + + # Configure the backend with path and level + Logger.configure_backend({LoggerFileBackend, :file_log}, path: "_build/dev.log", level: :debug )