--- src/main/Makefile.in	2006-04-13 00:08:32.000000000 +0300
+++ src/main/Makefile.in	2006-09-22 12:36:49.000000000 +0300
@@ -163,7 +163,7 @@
 	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c radwho.c
 
 radwho: radwho.lo util.lo log.lo conffile.lo ../lib/libradius.la
-	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LINK_MODE) -o radwho radwho.lo util.lo log.lo conffile.lo $(LIBS)
+	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LINK_MODE) -o radwho radwho.lo util.lo log.lo conffile.lo xlat.o client.o $(LIBS)
 
 
 clean:
--- src/main/log.c	2006-08-23 23:37:15.000000000 +0300
+++ src/main/log.c	2006-09-22 15:50:16.000000000 +0300
@@ -212,6 +212,41 @@
 	return r;
 }
 
+/*  Log the given msg with log_auth_format
+ *  or log_proxy_format appended, depending on the
+ *  lvl.. We are accepting L_AUTH and L_PROXY for 
+ *  
+ */
+
+int radlogx(int lvl, const char *msg, REQUEST *request)
+{
+    char xlatstring[MAX_STRING_LEN];
+    int res;
+	char logstr[MAX_STRING_LEN];
+
+
+	/*
+		The Log  
+	*/
+	
+	switch (lvl){
+		case L_AUTH:
+			sprintf(xlatstring, "%s%s", msg, mainconfig.log_auth_format);
+		break;
+		case L_PROXY:
+			sprintf(xlatstring, "%s%s", msg, mainconfig.log_proxy_format);			
+		break;
+	}
+
+    /*
+        We are going to use xlat_copy as the escape function.
+    */
+    res = radius_xlat(logstr, MAX_STRING_LEN, xlatstring, request, NULL);
+    res = vradlog(lvl, logstr, NULL);
+
+    return res;
+}
+
 int radlog(int lvl, const char *msg, ...)
 {
 	va_list ap;
--- src/include/radiusd.h	2006-04-13 20:15:56.000000000 +0300
+++ src/include/radiusd.h	2006-09-22 14:20:32.000000000 +0300
@@ -237,6 +237,10 @@
 	int		kill_unresponsive_children;
 	char		*log_file;
 	char		*checkrad;
+	
+	char	*log_auth_format;
+	char	*log_proxy_format;
+
 	const char      *pid_file;
 	const char	*uid_name;
 	const char	*gid_name;
--- src/main/mainconfig.c	2006-09-20 06:09:36.000000000 +0300
+++ src/main/mainconfig.c	2006-09-22 14:20:47.000000000 +0300
@@ -199,6 +199,10 @@
 	{ "log_auth", PW_TYPE_BOOLEAN, -1, &mainconfig.log_auth, "no" },
 	{ "log_auth_badpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_badpass, "no" },
 	{ "log_auth_goodpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_goodpass, "no" },
+
+	{ "log_auth_format", PW_TYPE_STRING_PTR, 0, &mainconfig.log_auth_format, ""},
+	{ "log_proxy_format", PW_TYPE_STRING_PTR, 0, &mainconfig.log_proxy_format, ""},
+
 	{ "pidfile", PW_TYPE_STRING_PTR, 0, &mainconfig.pid_file, "${run_dir}/radiusd.pid"},
 	{ "user", PW_TYPE_STRING_PTR, 0, &mainconfig.uid_name, NULL},
 	{ "group", PW_TYPE_STRING_PTR, 0, &mainconfig.gid_name, NULL},
--- raddb/radiusd.conf.in	2006-09-01 01:21:12.000000000 +0300
+++ raddb/radiusd.conf.in	2006-09-22 16:06:21.000000000 +0300
@@ -38,7 +38,7 @@
 #  tail of this file.
 #
 log_file = ${logdir}/radius.log
-
+log_auth_format = "[%{User-Name}] (from client %C port %{NAS-Port} cli %{Calling-Station-Id} did %{Called-Station-Id})"
 #
 #  Destination for log messages.  This can be one of:
 #
--- src/main/auth.c	2006-08-25 02:27:20.000000000 +0300
+++ src/main/auth.c	2006-09-22 16:09:30.000000000 +0300
@@ -122,12 +122,15 @@
 	}
 
 	if (goodpass) {
+		radlogx(L_AUTH, "Login Ok:", request);
+		/*
 		radlog(L_AUTH, "%s: [%s%s%s] (%s)",
 				msg,
 				clean_username,
 				mainconfig.log_auth_goodpass ? "/" : "",
 				mainconfig.log_auth_goodpass ? clean_password : "",
 				auth_name(buf, sizeof(buf), request, 1));
+		*/
 	} else {
 		radlog(L_AUTH, "%s: [%s%s%s] (%s)",
 				msg,
