How to send custom audit event from within custom class

Hi folks,

I'm developing a custom authentication class and need to send some custom audit events to Sentinel.

I've searched the developer docs but couldn't find any information.

How can I achieve this?

Regards,

  • Use the NIDPLog class to send a message to the log and configure audit to send that message as an event. It likely does already. You should not use the audit classes directly as the implementation can, and has, changed.

  • Maybe I'm doing something wrong.

    I've added the following call to the custom authentication class:

    NIDPLog.logAppInfo(String.format("Successfully authenticated %s", id));

    In catalina.out I get:

    <amLogEntry> 2022-05-25T20:57:20Z INFO NIDS Application: Successfully authenticated alice </amLogEntry>

    However it's not sent to sentinel.