You need to sign in to do that
Don't have an account?
אביב קסוטו
system.debug writes trimmed content
I have an issue where i run an apex class and print some objects along the way to log using `System.debug()`.
my problem is that for some reason, the log rows are getting written, but the value of the objects is being "trimmed". the size that it writes and which gets trimmed isn't consistent (sometimes it prints a lot of content sometimes less) but it does not write the entirety of the objects values i choose to log.
It does this to both SObjects and json encoded strings, and my entire log size is just about 80KB so i know i'm not breaking some size limit.
I also checked my log levels and everything is set as it should (again my logs are being written just not "fully").
for example, I have the json string:
`[{"sum":"2300","serial":"","repaymentDate":null,"payment":{"attributes":{"type":"Payment__c"},"Payment_Method__c":"Cash","checkdate__c":null,"Payment_Collected_Date__c":"2019-03-11"},"ownerId":null,"numOfPayments":null,"firstPaymentAmount":null,"digits":null,"cardType":null,"branch":null,"bank":"","account":""}`
But it gets written to the log file as:
15:29:57:085 USER_DEBUG [69]|DEBUG|payments json: [{"sum":"2300","serial":"","repaymentDate":null,"payment":{"attributes":{"type":"Payment__c"},"Payment_Method__c":"Cash","checkdate__c":null,"Payment_Collected_Date__c":"2019-03-11"},"ownerId":null,"numOfPayments":null,"firstPaymentAmount":null,"digits":null,"cardType":null,"branch":nu
any ideas?
my problem is that for some reason, the log rows are getting written, but the value of the objects is being "trimmed". the size that it writes and which gets trimmed isn't consistent (sometimes it prints a lot of content sometimes less) but it does not write the entirety of the objects values i choose to log.
It does this to both SObjects and json encoded strings, and my entire log size is just about 80KB so i know i'm not breaking some size limit.
I also checked my log levels and everything is set as it should (again my logs are being written just not "fully").
for example, I have the json string:
`[{"sum":"2300","serial":"","repaymentDate":null,"payment":{"attributes":{"type":"Payment__c"},"Payment_Method__c":"Cash","checkdate__c":null,"Payment_Collected_Date__c":"2019-03-11"},"ownerId":null,"numOfPayments":null,"firstPaymentAmount":null,"digits":null,"cardType":null,"branch":null,"bank":"","account":""}`
But it gets written to the log file as:
15:29:57:085 USER_DEBUG [69]|DEBUG|payments json: [{"sum":"2300","serial":"","repaymentDate":null,"payment":{"attributes":{"type":"Payment__c"},"Payment_Method__c":"Cash","checkdate__c":null,"Payment_Collected_Date__c":"2019-03-11"},"ownerId":null,"numOfPayments":null,"firstPaymentAmount":null,"digits":null,"cardType":null,"branch":nu
any ideas?
The output is
According to your statement "It does this to both SObjects and json encoded strings,", I am assuming this can give a possible explanation. Please take a look : https://developer.salesforce.com/forums?id=9062I000000QvOTQA0
Regards,
Krishna Avva