Problems with a long log file.

Problems with a long log file.

Post by Michel Bartolo » Wed, 10 Feb 1993 06:00:53



I need some creative ideas to handle the following. I run a Bourne shell
script which produces a very large log file. I do need all of the output for
my records. Currently, the log file is comprised of stdout and stderr.
Most of each log file is unique enough that the output from a diff of
the latest run of the script with a known 'good' run of the script would
be virtually all of the log file. What I would like to do, is get a copy of
stderr while retaining the stdout, and stderr in the original log file. I would
like to do it without disrupting the placement of the stderr and stdout
statements in the original log. ANY and ALL idea's will be appreciated.

---
Michel Bartolone

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
"We have seen the enemy, and he is us"
                                 Walt Kelly

 
 
 

Problems with a long log file.

Post by Jim Dav » Wed, 10 Feb 1993 16:52:42



>What I would like to do, is get a copy of
>stderr while retaining the stdout, and stderr in the original log file. I would
>like to do it without disrupting the placement of the stderr and stdout
>statements in the original log. ANY and ALL idea's will be appreciated.

I'm not sure I understand the last part of the requirement, but you might
try some judicious juggling of file descriptors.  Here's a contrived example:

Script started on Tue Feb  9 00:42:16 1993
wolf; cat foo.c
#include <stdio.h>
main()
{
        fprintf(stdout, "This is to stdout\n");
        fprintf(stderr, "This is to stderr\n");
        exit(0);

Quote:}

wolf; /bin/sh
$ (exec 3>&1; ./foo 2>&1 1>&3 3>&- | tee stderr.log) >stdout+stderr.log
$ cat stdout+stderr.log
This is to stderr
This is to stdout
$ cat stderr.log
This is to stderr
--
Jim Davis             | "Majorly weird."


 
 
 

Problems with a long log file.

Post by Tom Christianse » Thu, 11 Feb 1993 03:08:24



:I need some creative ideas to handle the following. I run a Bourne shell
:script which produces a very large log file. I do need all of the output for
:my records. Currently, the log file is comprised of stdout and stderr.
:Most of each log file is unique enough that the output from a diff of
:the latest run of the script with a known 'good' run of the script would
:be virtually all of the log file. What I would like to do, is get a copy of
:stderr while retaining the stdout, and stderr in the original log file. I would
:like to do it without disrupting the placement of the stderr and stdout
:statements in the original log. ANY and ALL idea's will be appreciated.

If you want to send stdout and stderr to the logfile, and then also
send stderr to another logfile, do this

    exec 3>log.all ; cmd args 2>&1 1>&3 | tee log.err 1>&3

If your tee supports -u for unbuffered output, then you should
use that to maintain the stderr messages in the same place.  If
it doesn't, and you want one, you can get one from convex.com
in /pub/perl/scripts/clones/tee if you want.

--tom

--

    Installing unix fixes the [VMS] bug.
        -Barry Shein

 
 
 

1. How can I split a log file into several log files?

Hello, I need to setup a log server.  This in itself is no problem, but if I
have several different systems
logging to one system and one logfile it makes it kind of hard to scan
through.
On the log server, there is the syslog file which contains several different
systems logs.
I'm trying to get something like:
syslog_system1
syslog_system2
syslog_system3
etc...
Does anyone know of a utility or script that could perform this for me?
Or is there something in syslog.conf I can do?
Thanks very much!
Don

2. Mirroring FTP software...

3. wierd stuffs in proxy log file and back end server log file

4. AGP VIDEO

5. Large File System and long long datatype (gcc)

6. salary ranges

7. Large file system support with C-Lib, gcc and long long

8. AIX 4.2.1- xlC problem with setitimer

9. long long & long double types in Linux GCC

10. RH7.2 2.4.X off_t: long or long long?

11. Linux has a long, long, long way to go

12. RH Linux: Bizarre wtmp/utmp, log file, and file date problems

13. SCSI file access problems and errors in log file