Jeff,

> I'm working on a SpamAssassin plugin for a university research project.
> I've debugged a lot of it by running SpamAssassin from the command line,
> and using the SA logger's dbg() and info() methods to output stuff.
>
> Now I need to put it in a production server and see the same debug
> information in the log file.  The production servers run Amavisd.
> The problem is that I can't get any output to the log file.  The only
> lines in the log file come from Amavisd, and not from SA itself.

When SpamAssassin is invoked by amavisd, the SA debug log goes to STDERR.
There is currently no configurable way to let amavisd hook into SA logging
and capture its output, although it is doable and on a TODO list.

For the moment you can redirect STDERR to a file and let it running
for a while for diagnostic purposes, e.g.:

# amavisd debug-sa >0.log 2>&1

or more selectively, e.g.:

amavisd-new-2.4.3 release notes:
- allow command-line option -d to specify a list of SA debug channel names;
  some useful examples:
    amavisd -d plugin,dkim,dk,spf         debug-sa
    amavisd -d auto-whitelist,bayes,learn debug-sa
    amavisd -d dcc,razor2,pyzor,util      debug-sa
    amavisd -d dns,uri,uridnsbl           debug-sa
    amavisd -d received-header,metadata   debug-sa
    amavisd -d rules,check                debug-sa

> I noticed that SpamAssassin uses Sys::Syslog and Amavisd uses
> Unix::Syslog so I thought that might be the reason.  After a
> little more searching I found that Sys::Syslog requires you to
> run syslogd with a -r qualifier.  So I edited the config file for
> syslogd and restarted it, but it didn't help.

amavisd would need to provide its own logging package and
insert it into Mail::SpamAssassin name space. Shouldn't be
too complicated, but I never needed it badly enough to do it.

  Mark

Reply via email to