NebulaLogger

The most robust logger for Salesforce. Works with Apex, Lightning Components, Flow, Process Builder & Integrations. Designed for Salesforce admins, developers & architects.

View the Project on GitHub jongpie/NebulaLogger

LoggerSObjectProxy class

Proxy class used as a middle layer between some problematic SObject Types and the rest of Nebula Logger's codebase. Each inner class maps to a corresponding SObjectType that is difficult to work with Apex for some reason or another, such as not being mockable or creatable, or not existing in all orgs.


Inner Classes

LoggerSObjectProxy.AuthSession class

All Schema.AuthSession SObjects are read-only in Apex, which makes them more difficult to work with, and impossible to mock field values directly during unit tests - even using tricks like JSON.deserialize() do not work. The LoggerSObjectProxy.AuthSession class acts as a substitute for a Schema.AuthSession record to provide the abilility to mock the data during unit & integration tests.


Constructors
AuthSession(Schema.AuthSession authSessionRecord)

Properties
Idpublic
LoginHistorypublic
LoginHistoryIdId
LoginTypeString
LogoutUrlString
SessionSecurityLevelString
SessionTypeString
SourceIpString
UsersIdId

LoggerSObjectProxy.LoginHistory class

All Schema.LoginHistory SObjects are read-only in Apex, which makes them more difficult to work with, and impossible to mock field values directly during unit tests - even using tricks like JSON.deserialize() do not work. The LoggerSObjectProxy.LoginHistory class acts as a substitute for a Schema.LoginHistory record to provide the abilility to mock the data during unit & integration tests.


Constructors
LoginHistory(Schema.LoginHistory loginHistoryRecord)

Properties
ApplicationString
BrowserString
PlatformString
UserIdId

LoggerSObjectProxy.Network class

Not all orgs have the SObject Schema.Network - it is only present in orgs that have enabled Experience Cloud Sites (communities/networks), so Schema.Network has to be referenced dynamically, including using hardcoded String values for field API names. The LoggerSObjectProxy.Network class acts as a substitute for a Schema.Network record so that the rest of the codebase can rely on strongly-typed references to fields (properties).


Constructors
Network(SObject networkRecord)

Properties
IdString
NameString
UrlPathPrefixString