I am new to CA API Gateway.
I am trying to create a policy fragment for logging the request parameters for the API.
On the API, I have created a Log Sink with default properties , meaning it's a file based logging.
As per documentation for JS assertion, involving logger , it suggests that logged parameters can only be written to Syslog .
logger.log(LOG_LEVEL.INFO, "The name from the request is: " + username); // Log to SSG logs.
How can I log it into the custom log sink file?
The log file is created in the same directory as SSG logs (/opt/SecureSpan/Gateway/node/default/var/logs).
Thanks Seiji for the response.
Also, do I need to add an Audit Detail Assertion in Policy Fragment?
The classpath is for the logger binding object in JS assertion.
No, you don't need to use any Audit Detail Assertions for the logger.log() method in JS assertion.
The output of the logger.log() method is recorded in the SSG logs (e.g. ssg_0_0.log), not in the Audit logs.
I removed the logger.log(), from JS Code written using assertion. The log file did not have the data created for an API. Only when I add it , I can see the log data coming into the file, of course, also in SSG log (which I want to avoid).
Is there any config which I am missing?
Also, I tried using the same approach for another API, to have individual log per API, but the log data for API A is written in API B.