Trying to save info to the logs using cflog, and save in JSON format. But for some reason, an extra dbl-quote is getting added next to each already existing dbl-quote.
Example: I do something like this, turning a simple struct into a JSON string:
<cfset local.fname = "Max">
<cfset local.lname = "Smith">
<cfset local.id = "QA-123">
<cflog text="#serializeJSON(local)#">
And in the logs, it gets saved to look like:
"INFO","http-apr-8888-exec-6","10/04/2021","19:24:46","","{""fname"":""Max"",""lname"":""Smith"",""id"":""QA-123""}"
Then if I try to save it this way, I get no quotes, and thus invalid JSON.
<cflog text='{fname:Max,lname:smith,id:QA-123}'>
results in:
"INFO","http-apr-8888-exec-6","10/04/2021","19:24:46","","{fname:Max,lname:Smith,id:QA-123}"
And
<cflog text='{"fname":"Max","lname":"smith","id":"QA-123"}'>
results in the same as the first example:
"INFO","http-apr-8888-exec-6","10/04/2021","19:24:46","","{""fname"":""Max"",""lname"":""Smith"",""id"":""QA-123""}"
Why is it doing this, and how do I end up with the log entry I want, without any extra quotes?:
"INFO","http-apr-8888-exec-6","10/04/2021","19:24:46","","{"fname":"Max","lname":"Smith","id":"QA-123"}"