]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/log.c
Correctly re-open syslog logging after reading of configuration
[ngircd-alex.git] / src / ngircd / log.c
index 80b2c056001daeb518012a8ce59782ff8e619eac..d81bec2496a8c966b1771926564f26bcf404a2a8 100644 (file)
@@ -64,6 +64,12 @@ Log_Message(int Level, const char *msg)
 }
 
 
+/**
+ * Initialitze logging.
+ * This function is called before the configuration file is read in.
+ *
+ * @param Daemon_Mode Set to true if ngIRCd is running as daemon.
+ */
 GLOBAL void
 Log_Init(bool Daemon_Mode)
 {
@@ -80,6 +86,23 @@ Log_Init(bool Daemon_Mode)
 } /* Log_Init */
 
 
+/**
+ * Re-init logging after reading the configuration file.
+ */
+GLOBAL void
+Log_ReInit(void)
+{
+#ifdef SYSLOG
+#ifndef LOG_CONS     /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
+#define LOG_CONS 0
+#endif
+       closelog();
+       openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
+#endif
+       Log(LOG_NOTICE, "%s started.", NGIRCd_Version);
+}
+
+
 GLOBAL void
 Log_Exit( void )
 {