At 16:21 08.09.2005, you wrote:
At 07:36 AM 9/8/2005, M. Kellermann wrote:
hi list,
since there was no response for over a month i'll try it again:
when using the -t logfile option (debugging disabled) qpopper logs
to the given
file instead of syslog. but i see blank lines between the entries...?
example:
Aug 17 17:14:39.768 2005 [20525] (v4.0.8) Servicing request from blabla
Aug 17 17:14:39.768 2005
Aug 17 17:14:39.829 2005 [20525] Stats: username 0 0 0 0 blabla
Aug 17 17:14:39.829 2005
Aug 17 17:14:40.968 2005 [20528] (v4.0.8) Servicing request from blabla
Aug 17 17:14:40.968 2005
Aug 17 17:14:41.013 2005 [20528] Stats: username 0 0 0 0 blabla
Aug 17 17:14:41.013 2005
huh? is this normal behaviour?
The code in the function vlogit() in common/logit.c explicitly does
this. I have no idea WHY it explicitly does this, but it does.
You'll find there two fprintf() calls followed by an fflush(). The
second fprintf is the issue.
Anyone know why? Should we just remove the second fprintf?
i tried removing the second fprintf, and now my logit.c looks like this:
.....
date_time = ctime ( (time_t *) &tval.tv_sec );
pDate = date_time + 4; /* skip day of week name */
iDateLen = strlen ( pDate ); /* length including year */
pYear = pDate + ( iDateLen - 5 ); /* point to start of year */
date_time [ iDateLen - 2 ] = '\0'; /* cut off the year */
lMsec = (tval.tv_usec + 500) / 1000; /* convert useconds
to milliseconds */
fprintf ( str, "%s.%03ld %.4s [%ld] %s\n",
pDate, lMsec, pYear, (long) getpid(), msgbuf );
fflush ( str );
}
else {
syslog ( loglev, "%s", msgbuf) ;
}
if ( iChunk == -1 ) {
/*
* We blew out the format buffer.
*/
if ( str ) {
fprintf ( str, "%s [%ld] Buffer size exceeded logging msg: %s\n",
date_time, (long) getpid(), format );
fflush ( str );
}
else {
.....
but it doesnt solve the blank lines.... ;(
C has never been my friend....but, doesnt the \n in the fprintf statement
mean "new line" ??
any programmers hints welcome...
thanks
MK
qpopper is started via xinetd:
server = /usr/sbin/popper
server_args = qpopper -s -R -t /var/log/pop.log
logging works fine .... but where do these empty lines with just
the timestamp and no logging text come from?
is noone but me logging to a separate file?
i cant believe that this is a qpopper bug...
thanks again in advance
MK