--- freem/src/fmadm.c 2025/04/15 02:24:43 1.38 +++ freem/src/fmadm.c 2025/04/15 16:49:36 1.39 @@ -1,5 +1,5 @@ /* - * $Id: fmadm.c,v 1.38 2025/04/15 02:24:43 snw Exp $ + * $Id: fmadm.c,v 1.39 2025/04/15 16:49:36 snw Exp $ * FreeM Administration Tool * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: fmadm.c,v $ + * Revision 1.39 2025/04/15 16:49:36 snw + * Make use of logprintf throughout codebase + * * Revision 1.38 2025/04/15 02:24:43 snw * Improve FreeM logging capabilities * @@ -144,6 +147,7 @@ #include "transact.h" #include "namespace.h" #include "fs.h" +#include "log.h" #ifdef HAVE_LIBREADLINE # if defined(HAVE_READLINE_READLINE_H) @@ -391,6 +395,7 @@ int main (int argc, char **argv) printf ("action = '%s' object = '%s' environment = '%s' namespace = '%s' config_file = '%s' base_arg = '%d' next argument = '%s'\n", action, obj_str, fma_environment, fma_namespace, config_file, base_arg, argv[base_arg]); exit(1); */ + init_log (); /* override for fmadm configure and daemon stuff */ if (got_action) { @@ -1796,6 +1801,15 @@ void fm_configure (void) snprintf (buf, sizeof (buf) - 1, "env_path=%s/freem/%s", LOCALSTATEDIR, fma_environment); fm_write (fp, buf); + + snprintf (buf, sizeof (buf) - 1, "log_threshold_file=info"); + fm_write (fp, buf); + + snprintf (buf, sizeof (buf) - 1, "log_threshold_syslog=info"); + fm_write (fp, buf); + + snprintf (buf, sizeof (buf) - 1, "log_threshold_stderr=warning"); + fm_write (fp, buf); fclose (fp); fprintf (stderr, "[OK]\n"); @@ -1806,6 +1820,9 @@ void fm_configure (void) update_conf (env_config_file, fma_environment, "user", env_user); update_conf (env_config_file, fma_environment, "group", env_group); update_conf (env_config_file, fma_environment, "enabled", env_enabled); + update_conf (env_config_file, fma_environment, "log_threshold_file", "info"); + update_conf (env_config_file, fma_environment, "log_threshold_syslog", "info"); + update_conf (env_config_file, fma_environment, "log_threshold_stderr", "warning"); } if (reconfigure == FALSE) {