[Nut-upsdev] stop spamming logs

Henning Brauer hb-nut at bsws.de
Wed Aug 23 11:11:18 UTC 2006


nut is awful at spamming my logs with useless information. this really 
belongs to debug level.

$OpenBSD$
--- server/netuser.c.orig	Wed Aug 23 11:52:15 2006
+++ server/netuser.c	Wed Aug 23 11:53:10 2006
@@ -61,7 +61,7 @@ void net_login(ctype *client, int numarg
 	ups->numlogins++;
 	client->loginups = xstrdup(ups->name);
 
-	upslogx(LOG_INFO, "Client %s@%s logged into UPS [%s]%s",
+	upsdebugx(1, "Client %s@%s logged into UPS [%s]%s",
 		client->username, client->addr, client->loginups,
 		client->ssl ? " (SSL)" : "");
 
@@ -76,10 +76,10 @@ void net_logout(ctype *client, int numar
 	}
 
 	if (client->username)
-		upslogx(LOG_INFO, "Client %s@%s logged out",
+		upsdebugx(1, "Client %s@%s logged out",
 			client->username, client->addr);
 	else
-		upslogx(LOG_INFO, "Client on %s logged out", client->addr);
+		upsdebugx(1, "Client on %s logged out", client->addr);
 
 	sendback(client, "OK Goodbye\n");
 	client->delete = 1;
$OpenBSD$
--- server/upsd.c.orig	Wed Aug 23 11:50:05 2006
+++ server/upsd.c	Wed Aug 23 11:51:58 2006
@@ -463,7 +463,7 @@ static void answertcp(void)
 	else
 		last->next = tmp;
 
-	upslogx(LOG_INFO, "Connection from %s", inet_ntoa(csock.sin_addr));
+	upsdebugx(1, "Connection from %s", inet_ntoa(csock.sin_addr));
 }
 
 /* read tcp messages and handle them */
@@ -480,7 +480,7 @@ static void readtcp(ctype *client)
 		ret = read(client->fd, buf, sizeof(buf));
 
 	if (ret < 1) {
-		upslogx(LOG_INFO, "Host %s disconnected (read failure)",
+		upsdebugx(1, "Host %s disconnected (read failure)",
 			client->addr);
 		delclient(client);
 		return;



-- 
Henning Brauer, hb at bsws.de, henning at openbsd.org
BS Web Services, http://bsws.de
OpenBSD-based Webhosting, Mail Services, Managed Servers, ...



More information about the Nut-upsdev mailing list