Nebula logger - Error Notification
Package Edition of Nebula Logger
Unlocked Package
Package Version of Nebula Logger
v4.13.11
New Bug Summary
Hi, I don't know if it's a bug...
I'm receiveng a lot of emails, all with subject Nebula Logger - Error Notification - company (org id) and following message body:
Logger failed to save 1 LogEntryEvent__e records for _**username**_ (Schema.User ID: **_xxxxxxxxxxxxxxxxxxxxxxx_**)
Errors:
- StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c]
How to understand where above errors were raised?
Hi @itague - I think this is a bug, but I have not been able to reproduce the issue yet (see my comment here). Are you still receiving error emails about this?
Unfortunately I'm still receiveng too much emails like above. In our production Org, there is a batch job that call an external web service each 10 minutes and almost all logger.log calls send an email with this error.
@itague can you try updating your records in LoggerSettings__c to set IsDataMaskingEnabled__c to false? My theory is that data masking is part of the problem, so if you can change that value & the error emails stop, then I think that will validate my theory.
I'm afraid but IsDataMaskingEnabled__c is already set to false.
@itague thanks for checking the value of IsDataMaskingEnabled__c - since it's already false, then something else must be causing the problem. I'm reviewing the code & so far, nothing else seems to explain the issue, but I'll continue looking.
In your batch job, which logging methods are you using? Are you using something like Logger.debug('some string') to log? Or are you using any other methods/features/approaches for logging?
Hi, I'm using log.error('string', ex) method.
Hi! Sorry to resurrect a year-old issue; just wanted to report we've also started to receive these messages -- and somewhat out of the blue.
Logger failed to save 4 LogEntryEvent__e records for **username** (Schema.User ID: **user_id**)
Errors:
StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c]
StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c]
StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c]
StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c]
This is using v4.15.4.2 of the unlocked package (04t5Y0000015oklQAA) in a production org. We have Data Masking enabled, but that hasn't changed recently -- nor has the rest of the application's configuration, at least that I'm aware of.
I wonder if as an intermediate step, we could add more detail to these error emails to help us understand what the source of the issue might be?
Hi @jasonsiders no worries, thanks for letting me know you're also seeing this issue! In your case, is the issue happening somewhat consistently/frequently? If so, does updating your records in LoggerSettings__c to set IsDataMaskingEnabled__c to false make a difference? That setting hasn't helped others with this issue, but I'm still trying to figure out how this issue is happening (since there's already code that's attempting to truncate the Message__c field as needed).
Edit: and in terms of the email alerts - I'll see if there's a way to get some more meaningful info into the email. I don't want to necessarily include the value of Message__c in the field, in case there is any sensitive data, but I'll see if there's anything else I could include to help with troubleshooting.
@jongpie thanks - I'd never seen this issue before yesterday, and it happened a couple hundred times. I disabled IsDataMaskingEnabled__c about an hour ago, and haven't seen any come across since. I'll continue to monitor and let you know 🤞🏼
I did just remember we recently adjusted a Logger Scenario Rule for the "Apex Rollup" scenario (which tracks logs from the Apex Rollup/Nebula Plugin) to log INFO and above; previously, it was only logging WARN. That might have something to do with it, though as you said theoretically, the logs should still be truncated to the field length anyways
@jasonsiders thanks for the info! I've been diving into this part of the codebase, and I've finally found a few scenarios where data masking & truncation would definitely cause the error StatusCode: STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c].
I'm working on fixing the code + adding a few related enhancements, I'm hoping to have a release out either later this week or next week 🥳
@jongpie that's great news! 🎉 I meant to follow up on my last message that disabling data masking did completely eliminate the issue, so that makes sense.
Thanks again for all your work on this project!
@itague and @jasonsiders I've just published release v4.16.1, which includes several improvements for both data masking & text truncation. My hope is that this solves errors like STRING_TOO_LONG, Message: Value too long for field, Field(s): [Message__c] - once you've had a chance to upgrade, please let me know if you run into these kinds of issues anymore.
Thanks again for all of your feedback!