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.



>         Wietse
>
> > Options:
> >
> > - Configure the syslog library destination, if your syslog
> >   library has such an option.
> >
> > - Link Postfix with a syslog library that can be configured to send
> >   to a different destination.
> >
> > - Configure a local syslog server to forward the logging without
> >   writing it to file.
> >
> > > If so, can I put a feature request to be able to adjust which syslog
> server
> > > postfix logs to as well as ability for postfix to log to stdout/stderr.
> >
> > Stdout/stderr logging may not be a good idea for a production mail
> > server. How would one separate records that are written concurrently?
> > Note that stderr is not buffered, i.e. one byte per write(2) call.
> >
> >       Wietse
> >
>

Reply via email to