Skip to main content
obxBill
New Participant
February 17, 2025
Question

ColdFusion 2023 HF12 Finding - writeLog() and JSON

  • February 17, 2025
  • 1 reply
  • 350 views

ColdFusion 2023 HF12 Finding writeLog() function.  Following CF2023 server update to HF12, If a JSON string is passed as part of the text input to the writeLog() function, it double quotes {""key"":""value""} all JSON key/value pairs in the log.  Prior to HF12, JSON was logged normally {"key":"value"}.  Anyone able to confirm/verify this finding and whether there is a way to resolve?  thx! 

    1 reply

    Community Expert
    February 17, 2025

    Try using single quotes to see what happens - but open a support ticket at tracker.adobe.com (I think that's the right URL) anyway.

     

    Dave Watts, Eidolon LLC
    obxBill
    obxBillAuthor
    New Participant
    February 17, 2025

    well, we are using serializeJSON() to create the json body, thus that function only creates valid {"key":"value"} json strings.  likely if could do single quote JSON, it will likely output as {"'key'":"'value'"}.  I will look at opening a tracker ticket based on the finding.  Perhaps there is a java argument possible to suppress some change in the CF engine tied to a update to writeLog().

     

    Fortunately, CF continues to create valid JSON and this issue only ties to writing logs.

    Community Expert
    February 17, 2025

    You shouldn't have an issue with CF doubling single quotes. That said, I don't really see how you'd get to where you can control how the CF error logger rewrites the output of serializeJSON. You could create a temporary wrapper for the function that conditionally rewrites the quotes after the JSON has been created, based on a feature flag. I'm not sure it's worth the effort for you though.

     

    Dave Watts, Eidolon LLC