First see here how to make an "Action Config to run one instance of a task". This couples a log event code to an action config. When a log message with the configured event code is logged and reaches the central database, the action config is triggered. The tag in the action config has to refer to a MC_SystemAlerter task that can send emails.
Then use the info here to create a new MC_SystemAlerter task. For the new task use the tag from the action config and make it a one-off task. The xml file that needs to be uploaded contains the settings for the emails (see mcSystemAlerter.xsd schema). In here it is possible to use the tag %LOG% in the body of the email. This tag will then be replaced by the logmessage(s) that triggered sending the email.
When scheduling the task, set the start time somewhere in the future, otherwise the task runs immediately. Then search the new task in "scheduled tasks" and set it to suspend. When the action config is triggered, then it copies the suspended task and runs the copy once.
Example sending emails with logentries and reports
The result will be that a CSV file is attached containing the relevant logentries.
NB. Note that the fromaddress field is an optional field that will fallback to InternetAddress.getLocalAddress() which is according to specification but in rare cases
will fail to provide a suitable fromaddress and will cause errors in the synchronisation_log.txt (where the MCSystemAlerter logs its errors).
Including the correct fromaddress will resolve this matter. Also when the Master Controller DNS is not configured properly this may result into slowness in the System Alerter.