How to log the request received by WebApi's if it is exposed for third party system to consume?

Hi,

 

We have Webapi's which are exposed to third party system to consume, I would like to know how to enable logs to know the request/response details which has been received/sent whenever the webapi is invoked by the third party system.

We are calling Expression Rules from our Webapi and not triggering any processes.

 

 

Regards,

Balaji.R

  Discussion posts and replies are publicly visible

Parents
  • Hi Balaji,

    I did not come across this but, I have one work around for this. We can write one custom plugin which intern will log the request and response to some log file. Code will be like the plain java code with custom logger.

    Hope this may help.
  • 0
    A Score Level 1
    in reply to Shanmukha
    Hi Shanmukha,

    Thanks for your response, and I never been part of Plug-in creation, so if possible can you give me some insights on Plug-in creation which may serve the logging purpose.


    Regards,
    Balaji.R
  • 0
    A Score Level 1
    in reply to rp_balaji
    Hi Balaji,
    You can get this basic info from forum itself. I have created all the plug-ins based on that. Cmg to logging then you have to follow basic logger mechanism like Java.

    Let me know if you need more info.
  • Hi Balaji -

    You certainly can investigate building a plugin for this.

    I personally would recommend that you consider using an approach similar to what  proposed, though.

    Using the database to track the transactions that reach Appian is easy to set up and reliable.

    Longer term maintenance of this utility is going to be easier in the database than maintaining a plugin as well.

    Also, you said you want to "enable logs to know the request/response details which has been received/sent whenever the webapi"

    That's a lot of data to manage in log files.  These could grow very large, and we don't know how well your plugin is going to manage generating all those logs.  I suspect you wish to avoid doing anything that will slow down your system.

    Consider looking for a way to log all of this at the network layer, outside of Appian.

Reply
  • Hi Balaji -

    You certainly can investigate building a plugin for this.

    I personally would recommend that you consider using an approach similar to what  proposed, though.

    Using the database to track the transactions that reach Appian is easy to set up and reliable.

    Longer term maintenance of this utility is going to be easier in the database than maintaining a plugin as well.

    Also, you said you want to "enable logs to know the request/response details which has been received/sent whenever the webapi"

    That's a lot of data to manage in log files.  These could grow very large, and we don't know how well your plugin is going to manage generating all those logs.  I suspect you wish to avoid doing anything that will slow down your system.

    Consider looking for a way to log all of this at the network layer, outside of Appian.

Children
  • Hi Rob,

    Thanks for your response, i am also with you by choosing the option of logging the data in to database but I would like to explore on the options of writing plugins to log the request/response data into log files.

    And regarding the point about data management in log files for logging each request and response, I am thinking of an approach of using flags (which will be stored in constants) to decide when to log and when not to log data. In that way I think we can restrict every request/response getting logged in the log file.

    I would like to seek you suggestion in terms of performance on the mentioned approaches, i.e., 1) writing data into Appian DB or 2) writing data outside Appian (either in DB or filesystem) or 3) writing request/response into Appian log files only on demand. Among the three approaches please let me know which one would be a better approach in terms of performance.

    Regards,
    Balaji.R