-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log but no entries #199
Comments
I turned off the logging level on the two actions so that it used the default (which is?), but it didn't make any difference. Still only a log created, no log entries. |
Hey @vr8hub - it sounds like you're doing everything correctly, so it could be a bug of some sort. I've seen similar issues happen before where the One option you can try is updating your Logger Setting entry to use SYNCHRONOUS_DML as the default save method (instead of EVENT_BUS), and then try running your Flow again - that will (hopefully) show you whatever error is happening that's preventing the |
I made the change, but no difference—I still got just a Log record with no LogEntries, and no error. I checked and the SysAdmin profile has full privileges on both objects (Log and LogEntry). I also added a plain "Add Log Entry" to see if it was isolated to the record collection action; it's not, i.e. I still didn't get any log entries even after that (total of three actions, one Add Log, two Add Log Record Collection). |
So sorry, spoke too soon. I didn't notice—something (SF?) created an org default for the Logger settings, and it was that I changed to sync, not my user settings. So I deleted my user settings since SF apparently doesn't like a user having settings when there isn't an org default. I ran it again, and this time got an error: |
@vr8hub we can arrive at a more elegant solution for this, but in the meantime, if you navigate to the insert this.logEntries; to: Database.DMLOptions dmlOptions = new Database.DMLOptions();
dmlOptions.AllowFieldTruncation = true;
Database.insert(this.logEntries, dmlOptions); That will get you back on track for now. |
So the LogEntryHandler class assigns the FlowDescription in LogEntry to the description from FlowDefinitionView, and in running that query manually, this particular flow's description (and several others of ours) have a description that's longer than 255 characters. So I'm guessing that assignment is what's blowing up. |
Ahh, very good James, I posted before I saw your message. I'll make that change, thanks for your help! |
no problem, happy to help. Truncated field values are something we've looked at in other areas of logger, but in thinking about it, it makes sense that the Flow description could exceed 255 characters - we'll probably need to do an audit for other areas where this error might present itself! 😅 |
Before I make that change… is that going to work? If the assignment is what's causing the problem, isn't the insert too late to catch it? IOW, isn't it dying when the assignment is made, rather than when the insert happens? |
I just added .left(255) to the end of the assignment in LogEntryHandler, and that got rid of the error, and lo and behold I have Log Entries. Yea! Thank you both for all your help, and sorry for all the trouble! |
…field-truncation for LogEntry__c inserts (reported in #199)
…field-truncation for LogEntry__c inserts (reported in #199)
* Made record & records parameters optional in FlowRecordLogEntry & FlowCollectionLogEntry (respectively) to handle situations where null is passed (e.g., Get Records returns null for no matches, instead of an empty list) (reported in #198) * Changed FlowDescription__c.field to long text area + added automatic field-truncation for LogEntry__c inserts + added a ridiculously long description to one of the Flows in nebula-logger-recipes (reported in #199) * Made fancier buttons that include the release number * Cleaned up a few areas in README * Added 'Code Quality Tests' to deploy.yml + ran prettier * Setup ESLint for lwc + fixed some reported issues * Removed some unused scripts in package.json
* Added StripInaccessibleRecordFields__c setting * Added all CMDT objects to LoggerAdmin.permissionset * Added LogEntryDataMaskRule__mdt object for applying data mask rules to log entry message & record JSON fields in LogEntryEventBuilder * Added CMDT rules for credit card numbers & social security numbers * Added setting ApplyDataMaskRules__c to control if CMDT data mask rules are applied * Added some user managament settings to scratch-def files * Added test suites for each module * Moved some test helper methods to LoggerTestUtils, cleaned up LogEntryEventBuilder_Tests methods * Optimized setTagsDetails() * Made record & records parameters optional in FlowRecordLogEntry & FlowCollectionLogEntry (respectively) to handle situations where null is passed (e.g., Get Records returns null for no matches, instead of an empty list) (reported in #198) * Changed FlowDescription__c.field to long text area + added automatic field-truncation for LogEntry__c inserts + added a ridiculously long description to one of the Flows in nebula-logger-recipes (reported in #199) * Made fancier buttons that include the release number * Cleaned up a few areas in README * Added 'Code Quality Tests' to deploy.yml + ran prettier * Setup ESLint for lwc + fixed some reported issues * Removed some unused scripts in package.json * Switched back to using extra-tests folder, created LogEntryEventBuilder_IntegrationTests class (AccountBrand doesn't exist in all orgs) * Added new step to pipeline to create an unvalidated package version & auto-install it into the package-demo org, then reinstall the latest released package version * Reenabled Codecov.io integration in the pipeline * Added static code analysis / PMD through sfdx-scanner (#201 by @jamessimone) * Fixed line breaks not working when calling System.debug() @jamessimone and I had a lot of... "fun" with this one Co-authored-by: James Simone <[email protected]>
Sorry, apparently I'm this week's problem child.
I have two "Add Log Entry for SObject Record Collection" actions in a flow, and only those actions. Both have Save Log set to True, both with Logging Level set to DEBUG. Both are in the path that will get called. (Confirmed with debug before I put the logging in.)
The Flow completes successfully. However, the Logger console shows me only a Log__c entry, no Log Entries. After the first time it happened, I deleted the log (so no logs at all) and ran the flow again, same result. Since I'm only calling actions that should create a log entry, I don't know how that could be happening; if the log actions weren't getting hit at all, there wouldn't be a log record, but since there's a log record, that implies that they are getting hit, but there's no log entry records, which the actions should both be creating.
I have the Logger: Admin permission set assigned to my user. (I'm a sysadmin.) I also created a Logger Setting entry for my user (and only that one, no org default), with Logging Level set to DEBUG and Is Enabled checked, everything else defaulted (Read, 14, EVENT_BUS, etc.). With my level set to DEBUG and the flow actions set to DEBUG, my understanding is that they should be created.
What am I missing and/or doing wrong?
The text was updated successfully, but these errors were encountered: