This plugin allows you to log messages to a jlog message queue (jlogger(id, data)
).
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-jlog
yum install halon-extras-jlog
For the configuration schema, see jlog.schema.json. Below is a sample configuration.
Important!
If using the
/var/log/halon/
folder as in the sample below and it does not exist, when you create it - give it the same permission as thesmtpd
process is using. Eg.mkdir /var/log/halon chown halon:staff /var/log/halon
plugins:
- id: jlog
config:
queues:
- id: elastic
path: /var/log/halon/elastic.jlog
subscribers:
- myelasticreader
import { jlogger } from "extras://jlog";
jlogger("elastic", json_encode([]));
This plugin creates files needed and used by the smtpd
process, hence this plugin does not autoload when running the hsh
script interpreter. There are two issues that may occur
- Bad file permission if logs are created by the user running
hsh
not thesmtpd
process. - Mulitple subscribers on the logs file (
smtpd
andhsh
). Do use this plugin inhsh
ifsmtpd
is running and vice versa.
To overcome the first issue, run hsh
as root
and use the --privdrop
flag to become the same user as smtpd
is using.
hsh --privdrop --plugin jlog