From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MepgG-0006Me-Mj for garchives@archives.gentoo.org; Sat, 22 Aug 2009 12:26:49 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25202E00CC; Sat, 22 Aug 2009 12:26:46 +0000 (UTC) Received: from kcout01.prserv.net (kcout01.prserv.net [12.154.55.31]) by pigeon.gentoo.org (Postfix) with ESMTP id 05674E00CC for ; Sat, 22 Aug 2009 12:26:45 +0000 (UTC) Received: from opal.binro.org (adsl-dynamic-58-136-70-146.csloxinfo.net[58.136.70.146]) by prserv.net (kcout01) with ESMTP id <200908221226442010026hbve> (Authid: gbinet.atwoodr); Sat, 22 Aug 2009 12:26:44 +0000 X-Originating-IP: [58.136.70.146] Received: from opal.binro.org (localhost.localdomain [127.0.0.1]) by opal.binro.org (8.14.3/8.14.2) with ESMTP id n7MCQdgS005180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 22 Aug 2009 19:26:40 +0700 Received: (from robin@localhost) by opal.binro.org (8.14.3/8.14.2/Submit) id n7MCQdBR005178 for gentoo-user@lists.gentoo.org; Sat, 22 Aug 2009 19:26:39 +0700 From: Robin Atwood To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] problem filtering portage messages... Date: Sat, 22 Aug 2009 19:26:37 +0700 User-Agent: KMail/1.12.0 (Linux/2.6.28-gentoo-r1; KDE/4.3.0; x86_64; ; ) References: <4A8FAEB7.2090806@gmail.com> In-Reply-To: <4A8FAEB7.2090806@gmail.com> X-Face: .c^^1Tm5bSr;@/t2T;-0HM`{~wj)F]2C]Zr#!Ig5fi&$LV1E^;5jL{]08F@tj{f3,U(I[9 ;7R4jB8A7|mw7{K\OYFzCL_e/tAb)0_@07[e.}H`OE*na@7m=Op1.s0v3_3*|?#l|XD}n* ARBV@IdaVd!V&bo;Z/TEb}oJi_(}3VOa^tj;$zlk96>K*hb>PYbe6J`'7qh`?m!!/k]ezl _VIifMR#4kg*"'n/S&^4@4: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200908221926.38796.robin.atwood@attglobal.net> X-Archives-Salt: 1e8bfb16-4680-423d-b827-a609f8617427 X-Archives-Hash: cfdc8a1fb06d57069ab92de9f03fc547 On Saturday 22 August 2009, Jarry wrote: > Hi, > I have a log-server (syslog-ng) collecting logs from my servers. > Everything works for standard logs: clients forward them to server > where they are filtered (based on facility or application) and > splitted into a few files (for each client). > > The problem is with portage logs: I can not find any pattern > I could use to filter them out. For example, this is small part > of /var/log/emerge.log: > > 1250923552: *** emerge sync > 1250923552: === sync > 1250923552: >>> Starting rsync with rsync://140.211.166.165/gentoo-portage > 1250923665: === Sync completed with rsync://140.211.166.165/gentoo-portage > 1250923666: *** terminating. > 1250923760: Started emerge on: Aug 22, 2009 06:49:20 > 1250923760: *** emerge depclean > 1250923760: >>> depclean > ... > > Can I somehow force portage to write all its logs (summary.log, > emerge-fetch.log, emerge.log) in standard syslog format RFC-3164? > I mean with all that stuff like priority (facility), header > (timestamp, hostname), application, etc. Even better if portage > could write its logs to /dev/log... This came up on the Gentoo portage forum recently. What I do is this: 1. In /etc/conf.d/local.start add a line tail -F /var/log/emerge.log | awk '{$1="";print | "logger -t emerge -p local5.info"}' & 2. In /etc/syslog-ng/syslog-ng.conf add lines to the effect of: destination emerge { file("/var/log/emerge"); }; filter f_emerge { program(emerge); }; filter f_messages { level(info..emerg) and not facility(auth, authpriv, mail, news, cron, local0, local6) and not program(emerge); }; log { source(src); filter(f_emerge); destination(emerge); }; Restart syslog-ng and there you go. :) HTH -Robin -- ---------------------------------------------------------------------- Robin Atwood. "Ship me somewheres east of Suez, where the best is like the worst, Where there ain't no Ten Commandments an' a man can raise a thirst" from "Mandalay" by Rudyard Kipling ----------------------------------------------------------------------