AnsweredAssumed Answered

Logging HTTP Request Params to custom Log Sink File

Question asked by milindbangar79 on Jan 3, 2019
Latest reply on Jan 7, 2019 by milindbangar79

Hi All,


I am new to CA API Gateway.


I am trying to create a policy fragment for logging the request parameters for the API.


I am using Javascript assertion and have written the code, which is working fine for a test API. Used the documentation to get the context variables from request params perspective.


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?