Checking output logs
When EmailEngine is installed as a SystemD service, you can use standard SystemD tools for different tasks and logging.
For example, to tail output from EmailEngine, you can use the journalctl
command:
$ journalctl -t emailengine -f
-- Logs begin at Tue 2021-06-01 12:53:14 UTC. --
Oct 02 12:43:43 srv-01 emailengine[369048]: {"level":30,"time":1633178623716,"pid":369048,"hostname":"srv-01","msg":"Starting EmailEngine","version":"1.14.5","node":"16.8.0"}
Oct 02 12:43:43 srv-01 emailengine[369048]: {"level":20,"time":1633178623716,"pid":369048,"hostname":"srv-01","msg":"IMAP Worker Count","workersImap":4}
Oct 02 12:43:43 srv-01 emailengine[369048]: {"level":20,"time":1633178623716,"pid":369048,"hostname":"srv-01","msg":"Webhooks Worker Count","workersWebhooks":1}
Oct 02 12:43:43 srv-01 emailengine[369048]: {"level":20,"time":1633178623717,"pid":369048,"hostname":"srv-01","msg":"Submission Worker Count","workersWebhooks":1}
This output is not very well readable, but you can't directly use the log renderers shown here because of the metadata entries in front of EmailEngine output logs. These lines are not valid JSON, so the renderers would not be able to process these.
Luckily we can modify journalctl
output, so we can ask it to drop all the metadata and only show log entries from EmailEngine. This way, we can pipe that output to a log renderer of our choice.
$ journalctl -t emailengine -f -o cat | jq
{
"level": 20,
"time": 1633178713318,
"pid": 369143,
"hostname": "srv-01",
"msg": "Webhooks Worker Count",
"workersWebhooks": 1
}