[tpop3d-discuss] Ways to reduce log level?

Chris Lightfoot chris at ex-parrot.com
Wed, 8 Jan 2003 15:09:58 +0000


On Wed, Jan 08, 2003 at 06:49:01AM -0800, Rich wrote:
> running in debug or verbose. Is there a way to set a "log level" for
> tpop3d; instead of just off or on? Just knowing that a user checked
> their mail, a single line, would be plenty.

The simple answer, I'm afraid, is `no'.

These are the messages at level LOG_INFO which are ever
printed by tpop3d (this is from the CVS version, the
current released version is slightly different):

  auth_other_start_child: started authentication child `%s'
  auth_other_init: %s: will run as uid %d, gid %d
  auth_other_new_apop: child: %s
  auth_other_new_user_pass: child: %s
  auth_other_new_user_pass: child: %s
  auth_perl: (perl code): %s
  auth_perl_new_apop: (perl code): %s
  auth_perl_new_user_pass: (perl code): %s
  auth_perl_onlogin: (perl code): %s
  will notify DRAC server `%s' of logins
  will notify logins by WHOSON
1 authcontext_new_apop: began session for `%s' with %s; uid %d, gid %d
2 authcontext_new_user_pass: began session for `%s' with %s; uid %d, gid %d
  ioabs_tcp_post_select: client %s: connection closed by peer
  dotfile_check_stale: removed stale lockfile `%s' (pid was %d)
3 maildir_sendmessage: sending message %d (%s) size %d bytes
  mailspool_new_from_file: stat(%s): %m
  parse_listeners: %s
  experimental BSD mailbox metadata cache enabled
  TCP Wrappers support enabled, using daemon name `%s'
  %d authentication drivers successfully loaded
4 listeners_post_select: client %s: connected to local address %s:%d
5 fork_child: %s: began session for `%s' with %s; child PID is %d
  net_loop: timed out client %s
6 connections_post_select: client %s: finished session for `%s' with %s
  connections_post_select: client %s: disconnected; %d/%d bytes read/written
  net_loop: tpop3d version %s successfully started
  net_loop: restarting on signal %d
  net_loop: terminating on signal %d
  connection_do: client %s: negotiating TLS connection
  connection_do: client %s: tried and failed to negotiate TLS connection; closing connection
  connection_do: client %s: asked for TLS, not available

A number indicates that this message is printed routinely
for each connection.

I observe that a line is printed for sending messages only
for messages in a maildir. (Unless -v is switched on.) I
suggest you remove that, with this patch:

diff -u -r1.13 maildir.c
--- maildir.c   13 Nov 2002 20:08:59 -0000      1.13
+++ maildir.c   8 Jan 2003 15:08:05 -0000
@@ -180,7 +180,6 @@
         log_print(LOG_ERR, "maildir_sendmessage: open(%s): %m", m->filename);
         return 0;
     }
-    log_print(LOG_INFO, "maildir_sendmessage: sending message %d (%s) size %d bytes", i+1, m->filename, m->msglength);
     status = connection_sendmessage(c, fd, 0 /* offset */, 0 /* skip */, m->msglength, n);
     close(fd);


That will leave you with messages 4, 1 or 2, 5 and 6 for a
single normal session. Are you running a syslogd which
will allow you to filter messages on regular expressions
or something? If so, I suggest you use that. Otherwise,
you can go through the source code and change individual
messages to log level LOG_DEBUG (from LOG_INFO) to accord
with your needs.

This should get better in a future version.

-- 
``Intelligence has much less practical application than you'd think.''
  (Scott Adams, from `Dilbert')