API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  API Connect Gatewayscript Console.log

    Posted Wed October 26, 2022 11:19 PM
    Hello,

    Sorry for the basic question: Where can I see the output for API Connect (2018) Gatewayscript "Console.log" statement? I don't see in the Data Power System Log nor do I see it in API Analytics 'All Events'

    ------------------------------
    Samir DxC
    ------------------------------


  • 2.  RE: API Connect Gatewayscript Console.log

    Posted Thu October 27, 2022 12:49 AM
    Hi Samir,

    You can able to see in DataPower API Connect specific domain default logs place, but before you open the default logs you can enabled the log level to "debug", then only you can able to see all logs. but you can enable this while development only because it impact Performance.

    ------------------------------
    kandula nagababu
    ------------------------------



  • 3.  RE: API Connect Gatewayscript Console.log

    Posted Thu October 27, 2022 08:51 AM
    I assume there is no way to view the normal console.log messages, if it set to 'warning'. And there seems to be no way to turn on logging for only 1 API as opposed to all APIs

    ------------------------------
    Sam IBMer
    ------------------------------



  • 4.  RE: API Connect Gatewayscript Console.log

    Posted Mon October 31, 2022 04:12 AM
    Hi Sam,

    Usually when developing the API u can keep below any one Log level for observing the flow in the logs wise.
    Log levels:
    • debug
    • info
    • warn
    • error
    • fatal
    if you want the API with feature log information purpose, use the console.debug option, then when ever u enabled the debug level in Gateway u can see the log information.

    ------------------------------
    kandula nagababu
    ------------------------------



  • 5.  RE: API Connect Gatewayscript Console.log

    Posted Tue November 01, 2022 08:57 AM

    Hi Sam,

    Just as a FYI, I believe the console.log is equivalent to a console.info, so you can at least eliminate the debug logging messages by using info instead of debug in your logging target.

    > And there seems to be no way to turn on logging for only 1 API as opposed to all APIs

    The best you can do is to create your own logging target and filter what logs are captured by that logging target by client IP.   You could then test your API from that client IP which would minimize the amount logged.

    Best Regards,

    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 6.  RE: API Connect Gatewayscript Console.log

    Posted Mon October 31, 2022 10:59 AM
    Hello,

    This is the documentation where you should find what you are looking for :
    https://www.ibm.com/docs/en/datapower-gateway/2018.4?topic=methods-console-module



    ------------------------------
    Icham Berreghioua
    ------------------------------