To get a custom assertion to write logs to its own log sink, there are a few things that need to be configured on the gateway side to get this to work. The first being to actually configure the log sink, and the other is setting up a Cluster Wide Property.
All supported versions of the API Gateway
When creating a custom assertion, many people put debug logs in their source code to see what is going on as the policy eventually gets to the assertion. Instead of having it write the logs to the standard ssg log, you can write it to its own custom log sink.
The first part is to create the custom log sink:
The package name being used in this example is .com.example.l7tech.example (the same one that is referenced in the source code).
The next part is to reference the package in a Cluster Wide Property
The same package name being used in the source code and log sink is the same as the Cluster-Wide property.
After applying these two configurations on the gateway (assuming the source code you created has the right code in it for logging), you should start seeing logs for the custom assertion being written to the custom log sink.