Hi again,

I did some digging and found that there's a function in startup.lua called
force_console_logging, which overrides the log config for prosodyctl to force
logs to go to the console. I was able to work around this by sticking the
original logging config into the config under a different key so that
prosodyctl can also grab a reference to it. I've attached the patch below with
the aforementioned workaround. Does this look like a reasonable approach?

Best,
William

On Sat Apr 26, 2025 at 10:10 PM MDT, 'William Brawner' via prosody-dev wrote:
> Hi all,
>
> I've got a patch here to fix #868 (showing log file locations in prosodyctl
> about). Unfortunately it seems it doesn't actually work, because it's always
> printing out "console", which seems to indicate that I'm just reading the
> default config. Is there anything I'm doing that's obviously wrong here?
>
> Cheers,
> William

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/prosody-dev/D9QG2EZ8WVQ1.3JRPCTK2AXDKS%40wbrawner.com.
diff -r 8e91868c19a2 -r d5733648dd26 prosodyctl
--- a/prosodyctl	Sat Apr 26 13:36:55 2025 -0600
+++ b/prosodyctl	Wed May 07 21:03:04 2025 -0600
@@ -497,7 +497,7 @@
 	end
 	print("");
 	local logconfig = require "util.prosodyctl.logconfig";
-	local log_paths = logconfig.paths(configmanager.get("*", "log"));
+	local log_paths = logconfig.paths(configmanager.get("*", "original_logging_config"));
 	if #log_paths > 0 then
 		print("# Logging");
 		for _, path in pairs(log_paths) do
diff -r 8e91868c19a2 -r d5733648dd26 util/startup.lua
--- a/util/startup.lua	Sat Apr 26 13:36:55 2025 -0600
+++ b/util/startup.lua	Wed May 07 21:03:04 2025 -0600
@@ -554,6 +554,7 @@
 		end
 	end
 	config.set("*", "log", { { levels = { min = log_level or "info" }, to = "console" } });
+	config.set("*", "original_logging_config", original_logging_config)
 end
 
 local function check_posix()

Reply via email to