From owner-freebsd-bugs Mon Apr 13 18:50:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA16020 for freebsd-bugs-outgoing; Mon, 13 Apr 1998 18:50:05 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA16007; Mon, 13 Apr 1998 18:50:02 -0700 (PDT) (envelope-from gnats) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA15311 for ; Tue, 14 Apr 1998 01:46:50 GMT (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id SAA08590 for ; Mon, 13 Apr 1998 18:46:19 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma008588; Mon Apr 13 18:46:05 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id SAA06474; Mon, 13 Apr 1998 18:46:05 -0700 (PDT) Message-Id: <199804140146.SAA06474@bubba.whistle.com> Date: Mon, 13 Apr 1998 18:46:05 -0700 (PDT) From: Archie Cobbs Reply-To: archie@whistle.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/6292: syslogd cannot put kernel loggings into separate files Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6292 >Category: bin >Synopsis: syslogd cannot put kernel loggings into separate files >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 13 18:50:01 PDT 1998 >Last-Modified: >Originator: Archie Cobbs >Organization: Whistle Communications, Inc. >Release: FreeBSD 2.2.6-RELEASE i386 >Environment: FreeBSD 2.2.6-RELEASE >Description: Using syslogd, all messages logged by the kernel must go into a single file, whereas with user programs, you can "fork" output from different programs into different files, by using this construct in /etc/syslogd.conf: !ftpd *.* /var/log/ftp !ppp *.* /var/log/ppp.log My proposal is to allow this to work on messages from the kernel that have a "program" prefix, ie, the message begins with alphanumerics followed by a colon character. Then you can do this: !ipfw *.* /var/log/ipfw Since all ipfw rule matches are logged with the prefix "ipfw:" then they will all get sent to /var/log/ipfw instead of /var/log/messages. Admittedly, this is something of a hack.. but until someone comes up with a better system, this would be nice to have.. >How-To-Repeat: Match a logging ipfw rule. Watch the result go to /var/log/messages and get lost in the chaos. >Fix: Apply patch below to syslogd.c: >Audit-Trail: >Unformatted: >From owner-freebsd-isp@freebsd.org Wed Mar 25 11:56:44 1998 From: Archie Cobbs Message-Id: <199803251954.LAA15909@bubba.whistle.com> Subject: Re: ipfw logging... In-Reply-To: <35195EC2.4506F2DB@san.rr.com> from Studded at "Mar 25, 98 11:45:06 am" To: Studded@san.rr.com (Studded) Date: Wed, 25 Mar 1998 11:54:57 -0800 (PST) Cc: isp@freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] Sender: owner-freebsd-isp@freebsd.org X-Loop: FreeBSD.org Studded writes: > Archie Cobbs wrote: > > Try adding this to /etc/syslog.conf: > > > > !ipfw > > *.* /var/log/ipfw > > This doesn't work. IPFW logs to the kernel facility, although I > wouldn't mind seeing an option to change that. :) Yeah.. we do this on the InterJet and I forgot it was a custom hack. Try the following patch to syslogd.c and see if that helps. If so, I'll file the patch in a send-pr bug. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com *** syslogd.c Mon Mar 9 05:56:07 1998 --- /usr/prod/ia/whistle/bin/syslogd/syslogd.c Wed Nov 26 15:37:39 1997 *************** *** 537,544 **** int c, pri, flags; char *lp, *p, *q, line[MAXLINE + 1]; ! (void)strcpy(line, bootfile); ! (void)strcat(line, ": "); lp = line + strlen(line); for (p = msg; *p != '\0'; ) { flags = SYNC_FILE | ADDDATE; /* fsync file after write */ --- 464,477 ---- int c, pri, flags; char *lp, *p, *q, line[MAXLINE + 1]; ! /* See if kernel has provided a "program" prefix already */ ! for (p = msg; *p && isalnum(*p); p++); ! if (*p == ':' && (p - msg) < MAXLINE) { ! *line = 0; /* Use kernel's prefix */ ! } else { ! (void)strcpy(line, bootfile); /* Prefix with bootfile name */ ! (void)strcat(line, ": "); ! } lp = line + strlen(line); for (p = msg; *p != '\0'; ) { flags = SYNC_FILE | ADDDATE; /* fsync file after write */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message