Forum OpenACS Q&A: What are all the fields that Aolserver includes in the log?

Sample Row:
[24/Sep/2001:12:48:26][13522.138248][-conn22-] Notice: Querying '
    select count(*) from co_answers
     where question_id = 1009
       and object_id = 330
       and answer = '346';'
I don't understand what the second field is and I am unsure of the third. I believe its
[date] [process_id.???????][serial connection number] Severity:
the message.

I would love it if someone could confirm the connection number and explain the other field.


From aolserver/nsd/log.c:
Log(Ns_LogSeverity severity, char *fmt, va_list *argsPtr)
    . . .
    fprintf(fp, "%s[%d.%d][%s] %s: ", timebuf,
		Ns_InfoPid(), Ns_ThreadId(), Ns_ThreadGetName(), severityStr);
The third field is the thread id. The fourth is more functional. For connections it will be the connection number, but it can be all sorts of things, including -main-, -sched-, -socks-, and -thread<n>-.
Just to add some information:  The connection number is not monotonically increasing, aolserver reuses connection numbers for multiple page serves.
AOLserver maintains a pool of threads that handle each incoming connection, by amongst other things, allocating a Tcl interpreter, running your various filters, running the page itself, and running the trace filters.

The connection number is not the nth request that has been made to your server, but the nth thread started to handle the connections. Connection threads have an maximuum idle. If they are idle too long, they exit.

So amusingly, if you have a busy server in which connections threads are rarely idle and never exit, the connection numbers are very small. But if you have an idle server, which is rarely used, and in which connections threads usually timeout, the connection numbers grow large.