Service Virtualization

 View Only
  • 1.  Logging request/response using logger in external file on server

    Posted Feb 21, 2020 04:50 AM

    Folks,

    I want to log request/response to external file . I believe this can be done using Log4j scripting where one can get logger file in script itself .

    i am able to do this with _logger.info but it is writing to default file .

    I also want to create a separate file for each request received naming it with a unique id received in Request 

    Can you help on this please



    ------------------------------
    Regards
    Rahul V
    ------------------------------


  • 2.  RE: Logging request/response using logger in external file on server
    Best Answer

    Broadcom Employee
    Posted Feb 21, 2020 11:09 AM
    Hi Rahul,

    I am not sure how you can do with Log4j but you can create filters for Request/Response if they are not available in properties and then use "Save Property Value to File" filter to save them to Files(s).
    Note: When you are writing to File, make sure you use the path outside the Project path where you have access.

    -Prema


  • 3.  RE: Logging request/response using logger in external file on server

    Posted Feb 24, 2020 02:07 PM
    Just want to know how can i log request resposne to file using script inside Execute script step. Is it possible usign SLF4j ?
    Like when we use _logger object it logs in file like workstaion.log