[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

Re: logging of "loved" output

Kevin Korb conserver@sanitarium.net
Wed, 22 Jun 2005 12:37:34 -0700 (PDT)


This is the patch that I tried:
--- conserver/group.c.orig      2005-06-02 17:21:10.000000000 -0400
+++ conserver/group.c   2005-06-02 17:36:36.000000000 -0400
@@ -2558,8 +2558,7 @@
      * or output to unifiedlog if it's open
      */
     if (unifiedlog != (CONSFILE *)0 ||
-       (pCEServing->pCLwr == (CONSCLIENT *)0 &&
-        pCEServing->unloved == FLAGTRUE)) {
+       pCEServing->pCLwr == (CONSCLIENT *)0) {
        /* run through the console ouptut,
         * add each character to the output line
         * drop and reset if we have too much
@@ -2572,8 +2571,7 @@
                continue;

            /* unloved */
-           if (pCEServing->pCLwr == (CONSCLIENT *)0 &&
-               pCEServing->unloved == FLAGTRUE) {
+           if (pCEServing->pCLwr == (CONSCLIENT *)0) {
                write(1, pCEServing->server, strlen(pCEServing->server));
                write(1, ": ", 2);
                write(1, pCEServing->acline, pCEServing->iend);


Those are different line numbers than what you said but the text looks to be the same. The patch didn't seem to have any effect. All I get on stdout is the login/logout messages with nothing in between.

There is a difference in how conserver treats CRLF between -u and -U
because when I run -Ufile I get 1 timestamp at the top and then never
get another one.  The only time -U logs timestamps is when I am actually
logged in.

I already adapted my tools to use a file (actually a named pipe) so I am
happy with either making -u ouput everything or making -U act like -u in
terms of CRLF.  I just need one of them to work the way I want it to.

--
Kevin

On Wed, 22 Jun 2005, Bryan Stansell wrote:

Date: Wed, 22 Jun 2005 12:16:24 -0700
From: Bryan Stansell <bryan@conserver.com>
To: users@conserver.com
Subject: Re: logging of "loved" output

On Wed, Jun 22, 2005 at 02:18:15PM -0400, Kevin Korb wrote:
I have played with the -U option a bit trying to get it to output to
stdout with things like -U- but that didn't work.  I also discovered
that -u and -U seem to handle CRLF translations differently which is a
problem for me with -U.

yep, you have to give a filename to -U. '-' isn't special - it'll just create a file called '-'.

you shouldn't see any difference between the -u and -U output as far as
cr/lf are concerned...the code is writing the same data to each.  if you
end up seeing something, then it could be your tty doing translations of
that data when going to your terminal.

I took a look into the source code and attempted to comment out the if
command that prevents the logging of loved output but that didn't seem
to help and the conserver code is a bit too convoluted for my limited
knowledge of C.  Can anyone help with this?

check out lines 2644 and 2656 of conserver/group.c. you'll see checks for "pCEServing->pCLwr == (CONSCLIENT *)0". remove those and -u will output everything.

personally, i'd use -U with a filename and get the log parsing stuff to
just read from a file (lots of tools out there do that...gnu tail can
even do cool things to help).  or, even better, i'd be logging all the
console data to individual files and letting something like logsurfer do
it's magic to watch them all.  then you see *all* the data, instead of
the possibly-truncated info that -u/-U give you (yes, it truncates long
lines...because of the way it wants to output individual lines per
console, it has to buffer things to prevent madness on devices that
don't produce line-oriented output).

anyway, good luck - and hopefully something here helps.

Bryan
_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users