Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Logging not working as expected in Go SDK versions greater than 156

    Posted 06-06-2025 13:51

    While prepping for an update that will address some vulnerabilities in our infrastructure I am attempting to update the Genesys Cloud Go SDK to the latest version. After doing so I found that logging is not performing as expected. It has started emitting a log entry for every api call that is not json formatted and doesn't appear to follow the standard logging format. 

    As an example here are two separate runs of the exact same example code with the only change being the first run is sdk version 156 and the second is version 160 which is the current version at this time.

    In the following set of logs you will notice that after an update to a version greater than 156 there is now log entries like entry 1 and 4.

    Version 156 Logs:

    Microsoft Windows [Version 10.0.26100.4061]go run ./...
    {"date":"2025-06-06T06:10:56.2217529-07:00","level":"trace","method":"POST","url":"https://login.mypurecloud.com/oauth/token","requestHeaders":{"Authorization":["[REDACTED]"],"Content-Type":["application/x-www-form-urlencoded"]},"responseHeaders":{"Content-Length":["147"],"Content-Type":["application/json"],"Critical-Origin-Trial":["Tpcd"],"Date":["Fri, 06 Jun 2025 13:10:55 GMT"],"Inin-Correlation-Id":["--"],"Origin-Trial":["--"],"Strict-Transport-Security":["max-age=31536000"],"Vary":["Accept-Encoding"]},"correlationId":"--","statusCode":200,"requestBody":"grant_type=client_credentials"}
    {"date":"2025-06-06T06:10:56.2239811-07:00","level":"debug","method":"POST","url":"https://login.mypurecloud.com/oauth/token","requestHeaders":{"Authorization":["[REDACTED]"],"Content-Type":["application/x-www-form-urlencoded"]},"statusCode":200,"requestBody":"grant_type=client_credentials"}
    {"date":"2025-06-06T06:10:56.4574064-07:00","level":"trace","method":"GET","url":"https://api.mypurecloud.com/api/v2/ipranges","requestHeaders":{"Accept":["application/json"],"Authorization":["[REDACTED]"],"Content-Type":["application/json"]},"responseHeaders":{"Cache-Control":["no-cache, no-store, must-revalidate"],"Content-Length":["6194"],"Content-Type":["application/json"],"Date":["Fri, 06 Jun 2025 13:10:56 GMT"],"Inin-Correlation-Id":["--"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"Via":["1.1 --.cloudfront.net (CloudFront)"],"X-Amz-Cf-Id":["--"],"X-Amz-Cf-Pop":["LAX50-P2"],"X-Cache":["Miss from cloudfront"]},"correlationId":"--","statusCode":200}
    {"date":"2025-06-06T06:10:56.4574064-07:00","level":"debug","method":"GET","url":"https://api.mypurecloud.com/api/v2/ipranges","requestHeaders":{"Accept":["application/json"],"Authorization":["[REDACTED]"],"Content-Type":["application/json"]},"statusCode":200}

    Microsoft Windows [Version 10.0.26100.4061]

    UPGRADING TO VERSION 160:

    Microsoft Windows [Version 10.0.26100.4061]go mod tidy
    go: finding module for package github.com/mypurecloud/platform-client-sdk-go/v160/platformclientv2
    go: found github.com/mypurecloud/platform-client-sdk-go/v160/platformclientv2 in github.com/mypurecloud/platform-client-sdk-go/v160 v160.0.0

    Microsoft Windows [Version 10.0.26100.4061]go run ./...
    2025/06/06 06:12:37 [DEBUG] POST https://login.mypurecloud.com/oauth/token
    {"date":"2025-06-06T06:12:38.3353881-07:00","level":"trace","method":"POST","url":"https://login.mypurecloud.com/oauth/token","requestHeaders":{"Authorization":["[REDACTED]"],"Content-Type":["application/x-www-form-urlencoded"]},"responseHeaders":{"Content-Length":["147"],"Content-Type":["application/json"],"Critical-Origin-Trial":["Tpcd"],"Date":["Fri, 06 Jun 2025 13:12:37 GMT"],"Inin-Correlation-Id":["--"],"Origin-Trial":["--"],"Strict-Transport-Security":["max-age=31536000"],"Vary":["Accept-Encoding"]},"correlationId":"--","statusCode":200,"requestBody":"grant_type=client_credentials"}
    {"date":"2025-06-06T06:12:38.3365076-07:00","level":"debug","method":"POST","url":"https://login.mypurecloud.com/oauth/token","requestHeaders":{"Authorization":["[REDACTED]"],"Content-Type":["application/x-www-form-urlencoded"]},"statusCode":200,"requestBody":"grant_type=client_credentials"}
    2025/06/06 06:12:38 [DEBUG] GET https://api.mypurecloud.com/api/v2/ipranges
    {"date":"2025-06-06T06:12:38.5620522-07:00","level":"trace","method":"GET","url":"https://api.mypurecloud.com/api/v2/ipranges","requestHeaders":{"Accept":["application/json"],"Authorization":["[REDACTED]"],"Content-Type":["application/json"]},"responseHeaders":{"Cache-Control":["no-cache, no-store, must-revalidate"],"Content-Length":["6194"],"Content-Type":["application/json"],"Date":["Fri, 06 Jun 2025 13:12:38 GMT"],"Inin-Correlation-Id":["--"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"Via":["1.1 --.cloudfront.net (CloudFront)"],"X-Amz-Cf-Id":["--"],"X-Amz-Cf-Pop":["LAX50-P2"],"X-Cache":["Miss from cloudfront"]},"correlationId":"--","statusCode":200}
    {"date":"2025-06-06T06:12:38.5625631-07:00","level":"debug","method":"GET","url":"https://api.mypurecloud.com/api/v2/ipranges","requestHeaders":{"Accept":["application/json"],"Authorization":["[REDACTED]"],"Content-Type":["application/json"]},"statusCode":200}

    Microsoft Windows [Version 10.0.26100.4061] 


    #PlatformSDK

    ------------------------------
    Joshua Morlan
    Staff Engineer
    ------------------------------


  • 2.  RE: Logging not working as expected in Go SDK versions greater than 156

    Posted 06-06-2025 14:04

    Hi Joshua,

    That's weird.  Let me open a ticket with DevTooling team and have them investigate it.  It looks like a bug, I will ask them to post a response once they have dug into it.

    Thanks,
        John



    ------------------------------
    John Carnell
    Director, Developer Engagement
    ------------------------------



  • 3.  RE: Logging not working as expected in Go SDK versions greater than 156

    Posted 06-06-2025 15:05

    Thank you!



    ------------------------------
    Joshua Morlan
    Staff Engineer
    ------------------------------



  • 4.  RE: Logging not working as expected in Go SDK versions greater than 156

    Posted 06-10-2025 06:48

    Hello,

    That's indeed an issue on our side. It's the HTTP client logger doing this underneath (not disabled properly on create).

    Thanks for reporting this. We'll try to fix this for our next Go SDK build. I'll update this post once done.

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 5.  RE: Logging not working as expected in Go SDK versions greater than 156

    Posted 06-18-2025 04:50

    Hello,

    We have made a fix for this. It will be in the next Go SDK release (possibly over the week-end - if not, we'll force one build next week).

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 6.  RE: Logging not working as expected in Go SDK versions greater than 156
    Best Answer

    Posted 06-23-2025 05:05

    Hello,

    The fix has been released in the last SDK version - Go SDK v161.0.0

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 7.  RE: Logging not working as expected in Go SDK versions greater than 156

    Posted 06-23-2025 12:16

    That did it.  Thank you!



    ------------------------------
    Joshua Morlan
    Staff Engineer
    ------------------------------