Skip to content

Setting Origin__c on LogEntry__c #330

Answered by jongpie
TKGC asked this question in Q&A
Jun 13, 2022 · 1 comments · 15 replies
Discussion options

You must be logged in to vote

Hi @TKGC - right now, you could manually set the origin of the entry using something like this:

Logger.info('hello, world').getLogEntryEvent().OriginLocation__c = 'some value';

Essentially, whatever value you set on the platform event's field OriginLocation__c is ultimately what's stored in LogEntry__c.OriginLocation__c (which is used in the formula field LogEntry__c.Origin__c). I don't think this approach is ideal, as you would need to add additional logic to fully handle parsing a stack trace (which is something Nebula Logger already does internally), but it's something you could implement today. However, I already have some internal logic built to skip some classes when setting the field

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@TKGC
Comment options

@kevlar8
Comment options

@jongpie
Comment options

@kevlar8
Comment options

@jongpie
Comment options

Answer selected by TKGC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants