trusteddomainproject / OpenDKIM

Other
97 stars 52 forks source link

log to stdout/stderr in foreground mode #153

Open Augustin-FL opened 2 years ago

Augustin-FL commented 2 years ago

It would be useful to be able to get opendkim to log to stdout/stderr in foreground mode. This would be specially useful on systems where no log agent (rsyslog/syslog-ng/etc...) is installed, or on docker containers.

I found no way to achieve that for now. Also, it seems that someone on sourceforge is requesting the same feature.

neszt commented 1 year ago

This is really a much needed feature. Is there anything else missing in order for the PR to be accepted?

Protryon commented 1 year ago

A workaround that worked for me for use in docker containers: I hijacked the stdout FD and had rsyslog write directly to it: https://github.com/Protryon/postfix-docker/blob/master/opendkim/rsyslog.conf

The whole working dockerfile with stdout from opendkim: https://github.com/Protryon/postfix-docker/tree/master/opendkim

andreasschulze commented 1 year ago

based on https://github.com/facebookarchive/liblogfaf someone wrote code to let that library echo any application's syslog to STDOUT.

my version: https://github.com/facebookarchive/liblogfaf/compare/master...andreasschulze:liblogfaf:log2stdout

It's used for opendkim in containers here since years ...

LD__PRELOAD="/path/to/liblogfaf_stdout" /path/to/opendkim -x /path/to/opendkim.conf -f -l
schildbach commented 1 year ago

Yes, logging to stdout is really a basic feature, and much needed in security critical environments.