On Wed, Apr 16, 2008 at 7:39 AM, Salvatore Toribio <[EMAIL PROTECTED]> wrote: > At 13:08 -0400 15-04-2008, Asif Iqbal wrote: > > > > > And I see this log *only* in qmail-queue.log but not in syslog's > > mail.info (aka maillog yes) > > > > Tue, 15 Apr 2008 17:01:40 GMT:26206: +++ starting debugging for > > process 26206 (ppid=26197) by uid=7791 > > Tue, 15 Apr 2008 17:01:40 GMT:26206: w_c: Total time between DATA > > command and "." was 0.000247 secs > > Tue, 15 Apr 2008 17:01:40 GMT:26206: w_c: elapsed time from start 0.018104 > secs > > > > ....skip.... > > > > Tue, 15 Apr 2008 17:01:41 GMT:26159: ------ Process 26159 finished. > > Total of 9.778034 secs > > > > I do not want to turn off minidebug (set to `0') unless I can send > > those logs to syslog > > > > > > Sorry, but you won't see "those logs" in syslog. Qmail-scanner send to > syslog just some information, not the debug or minidebug log, for example > this is the log for a clear message: > > Apr 16 09:54:29 apo146 qmail-scanner[12796]: > Clear:RC:1(193.43.129.200):SA:0(2.7/6.0): 1.158852 5574 [EMAIL PROTECTED] > [EMAIL PROTECTED] > Fwd:_Re:_[Qmail-scanner-general]_debug_and_minidebug_to_sysloginstead__of_to_a_f > <[EMAIL PROTECTED]> > 1208332467.12798-0.apo146.pusc.it:5131 > orig-apo146.pusc.it120833246780812796:5574 > > If you run 'grep qmail-scanner maillog' you should find some lines like the > one above. > > So if you want all the information of minidebug in syslog you should modify > the minidebug routine. > Start from something like this: > > sub minidebug { > my (&msg) = @_ ; > return if (!$MINIDEBUG); > > my $msgtype = "qmail-scanner[$nprocess]"; > my $syslogtype='mail|info'; > > $msg =~s/[\x00-\x09]//g; > $msg =~ s/%/%%/g; > #Now ensure syslog record isn't larger than max syslog size of 1024 > chars > $msg=substr($msg,0,1024); > eval { > $SIG{ALRM} = sub { die "Maximum time writing to syslog exceeded. > syslog is hung/broken." }; > alarm 10; > eval { > syslog($syslogtype,"$msgtype: $msg"); > }; > if ($@) { > setlogsock('inet'); > syslog('mail|info',"$msgtype: $msg"); > } > }; > #The message is delivered - so no temp failure here - you just have to > lose the log entry... > alarm 0; > } > > Remember you are in your own... Test it well off-line, and then test it > again...
Salvatore, really appreciate your help. I would still think there "should" be an option to send the debug/minidebug log to send to either file or syslog instead of just file. May be a feature request for Jason Haar or patch request for you :-) > > Regards > > ST > -- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Qmail-scanner-general mailing list Qmail-scanner-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general