zhong ming wu:
> On Mon, Oct 30, 2017 at 8:45 AM, Wietse Venema <wie...@porcupine.org> wrote:
> 
> > Wietse Venema:
> > > zhong ming wu:
> > > > Hello,
> > > > I had successfully used postfix for years and now I am trying to
> > recreate
> > > > postfix clusters in docker and in particular interested in how I can
> > direct
> > > > all postfix logs from a container to other places.
> > > >
> > > > I do not find in postfix configuration how one can achieve this
> > without any
> > > > local syslog daemon.
> > >
> > > Syslog is a hard library dependency for Postfix. Why can't dockerd
> > > provide a syslog forwarder, just like it already provides a stdout
> > > and stderr forwarder? That would also help with other daemons that
> > > rely on syslog to avoid app-specific logfiles.
> >
> > A search for 'container syslog' turned up some results.  Apparently,
> > this can be done by mounting the host's logging sockets inside a
> > container.
> >
> > Example:
> > https://www.projectatomic.io/blog/2016/10/playing-with-docker-logging/
> 
> Great find!  It works well except it's not so simple to distinguish the
> logs between host mail log and container mail logs!   postfix is relying on
> the syslog daemon to add hostname information.

You can configure in main.cf:

    syslog_name = $myhostname/postfix (default=postfix)

This takes effect after reading main.cf. Errors that happen earlier
will be logged as "syslog_name = postfix".

        Wietse

Reply via email to