NebulaLogger icon indicating copy to clipboard operation
NebulaLogger copied to clipboard

Add Tag to LoggerSettings Setup Location

Open chazwatkins opened this issue 2 years ago • 4 comments

New Feature Summary

The current Setup Locations are great but don't allow developers to target specific processes or functionality where they've utilized tags for identification. Adding Tags to the Logger Settings Setup Location will allow developers to target log capture between Profile and User levels.

chazwatkins avatar Apr 27 '22 14:04 chazwatkins

Hi @chazwatkins! Any chance you could share some more details about your use case? Conceptually, I like the idea of adding a Tags field to LoggerSettings__c, but that would somewhat overlap with the functionality of the custom metadata type "Log Entry Tag Rules". I'm not sure if you've already explored that feature (if not, this wiki page has some details about it), but it provides a configurable way of adding tags. Let me know if that would be a possible option for your usage.

jongpie avatar Apr 28 '22 19:04 jongpie

Hi @chazwatkins just wanted to follow up on this again - do you have any more details you could share about your use case?

jongpie avatar Aug 09 '22 01:08 jongpie

Hey @jongpie,

Thanks for the bump. I forgot about his request completely.

I'd like to be able to enable log capture for one or more tags.

Benefit Hypothesis

Typically in Production, teams will opt to only capture ERROR logs so they can take action when they occur. However, the other log levels can help greatly when troubleshooting, answer questions about feature usage, or taking a quick peek to make sure everything is running as expected after deployment/release. So, if Logger could capture logs for a tag location, devs would be able to isolate issues or answer questions about features more quickly and effectively. The tag location would provide a level between/complimenting the existing Profile and User locations.

Scenario 1

  • I'm implementing Feature A and tag log entries with featureA
  • Feature A is now released to prod and I get a report of a possible issue with the new feature
  • Today: Get the specific username or profile and enable Logger Settings to capture logs for either. This is great, but now I have to filter further to see what logs pertain to Feature A. This can likely be accomplished with some searching using Logger Entry Event Stream.
  • Tomorrow: Enable Logger Settings to capture logs for one or more tags, including the featureA tag. Now, the only logs I'm capturing are specific to Feature A

Scenario 2

  • Again, we have an issue report for Feature A. This time, it seems only to affect users with the Manager profile.
  • Today: Enabler Logger Settings to capture logs for the Manager profile. Search for the featureA tag with filters or text search
  • Tomorrow: Enable Logger Settings to capture logs for the Manager profile and featureA tag. The logs will only be for users with the Manager profile and tagged with the featureA tag.

Scenario 3

  • Again, we have an issue report for Feature A. This time, it seems only to affect a single user.
  • Today: Enabler Logger Settings to capture logs for the username. Search for the featureA tag with filters or text search
  • Tomorrow: Enable Logger Settings to capture logs for the username and featureA tag. The logs will only be captured for the username and tagged with the featureA tag.

chazwatkins avatar Aug 09 '22 03:08 chazwatkins

Hey @chazwatkins, thanks so much for writing up these scenarios! It's some really great context for me. Offhand, I'm not sure how easily this could be implemented - currently, tags are applied after the code has already determined if logging is enabled/disabled for the current user, so I'll have to do some analysis & prototyping to see if there's a way to provide this functionality, or something comparable. I don't have an ETA yet on when I'll get to look into this further, but I'll keep you updated.

There is also conceptually some overlap with another feature called log scenarios, which is used to set the field Log__c.Scenario__c (so you can only set a single value for the scenario per transaction/log, versus when using tags, a single log entry can have multiple tags). The 'log scenario' functionality is still evolving, but it has the ability to create log scenario rules that somewhat handle the "tomorrow" functionality you've outlined. I need to also expand on the documentation for this feature, but if you happen to have a chance to look into it (if you haven't already), let me know if that would be a viable option for you.

Thanks again!

jongpie avatar Aug 10 '22 04:08 jongpie

Hey @jongpie - Log scenarios seem to fit the bill here. Thanks for pointing it out. I'm going to close the issue.

BTW, out team loves using Nebula Logger. Thanks for all the time you've put into it.

chazwatkins avatar Sep 19 '22 02:09 chazwatkins

@chazwatkins glad to hear that the log scenarios feature will work for you! And I'm glad to hear that your team loves using Nebula Logger! Just let me know if you/your team have any other questions.

jongpie avatar Sep 19 '22 16:09 jongpie