summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
authorSantosh P K <50885001+Spantik@users.noreply.github.com>2020-04-16 20:23:44 +0530
committerGitHub <noreply@github.com>2020-04-16 20:23:44 +0530
commit09133ff4f71a50e6cd15618ffc969604422f9436 (patch)
treec26ce24f253b8eb20b75483370c0728a4bf854f5 /lib/libfrr.c
parentc845358213872f1ec7b4e2c431fc62de353ff7ab (diff)
parent6c19e557a59c9301db3981eff40867be347dfb74 (diff)
Merge pull request #5451 from opensourcerouting/rcu-log
logging subsystem rewrite
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 9a681103d4..ac165f254e 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -33,7 +33,6 @@
#include "lib_vty.h"
#include "log_vty.h"
#include "zclient.h"
-#include "log_int.h"
#include "module.h"
#include "network.h"
#include "lib_errors.h"
@@ -630,6 +629,7 @@ struct thread_master *frr_init(void)
{
struct option_chain *oc;
struct frrmod_runtime *module;
+ struct zprivs_ids_t ids;
char moderr[256];
char p_instance[16] = "", p_pathspace[256] = "";
const char *dir;
@@ -657,9 +657,11 @@ struct thread_master *frr_init(void)
#endif
zprivs_preinit(di->privs);
+ zprivs_get_ids(&ids);
- openzlog(di->progname, di->logname, di->instance,
- LOG_CONS | LOG_NDELAY | LOG_PID, LOG_DAEMON);
+ zlog_init(di->progname, di->logname, di->instance,
+ ids.uid_normal, ids.gid_normal);
+ zlog_tls_buffer_init();
command_setup_early_logging(di->early_logging, di->early_loglevel);
@@ -709,7 +711,6 @@ struct thread_master *frr_init(void)
vty_init(master, di->log_always);
lib_cmd_init();
- log_filter_cmd_init();
frr_pthread_init();
@@ -1086,7 +1087,7 @@ void frr_run(struct thread_master *master)
}
/* end fixed stderr startup logging */
- zlog_startup_stderr = false;
+ zlog_startup_end();
struct thread thread;
while (thread_fetch(master, &thread))
@@ -1119,7 +1120,8 @@ void frr_fini(void)
/* signal_init -> nothing needed */
thread_master_free(master);
master = NULL;
- closezlog();
+ zlog_tls_buffer_fini();
+ zlog_fini();
/* frrmod_init -> nothing needed / hooks */
rcu_shutdown();