of log records (stuff that goes in citadel.log). It's not very big right
now, but I put it into its own file so that we can potentially do more with
it later.
lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
hook_start_session(CC->cs_pid);
+ rec_log(CL_CONNECT, "");
do {
time(&CC->lastcmd);
--- /dev/null
+/*
+ * Everything which needs some logging...
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <time.h>
+#include <ctype.h>
+#include <string.h>
+#include <errno.h>
+#include <pthread.h>
+#include <syslog.h>
+#include "citadel.h"
+#include "server.h"
+#include "proto.h"
+
+
+void rec_log(unsigned int lrtype, char *name) {
+ FILE *fp;
+ time_t now;
+
+ time(&now);
+ fp = fopen("citadel.log", "a");
+ fprintf(fp, "%ld|%u|%s\n", now, lrtype, name);
+ fclose(fp);
+ }
/*
- * readlog.c
- * v1.5
+ * readlog.c (a simple program to parse citadel.log)
*/
#include <stdlib.h>
time_t LogTime;
unsigned int LogType;
char LogName[256];
- struct usersupp usersupp;
int a, b, lowest;
float p, q;
long timeon[72];
prompt ();
PC_ONLY_HERE:
+
+
+/*
+ This report doesn't work anymore, because it requires reading the user
+ file directly, which can't happen.
printf ("Top 20 Contributing Users (post to call ratio)\n");
printf ("P/C Ratio Username\n");
printf ("--------- ------------------------------\n");
fclose (fp);
pclose (sortpipe);
exit (0);
+ */
}
}