-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit with fix for #117 by adding support for logging to big…
… objects in addition to the existing custom objects
- Loading branch information
1 parent
0d5b6db
commit 1b0ee74
Showing
111 changed files
with
1,787 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
nebula-logger/main/logger-engine/classes/LogEntryArchiveBuilder.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
global with sharing class LogEntryArchiveBuilder extends LogEntryEventBuilder { | ||
@testVisible private static LogEntryEvent__e mockEvent; | ||
|
||
public LogEntryArchiveBuilder(LoggingLevel loggingLevel, Boolean shouldSave) { | ||
super(loggingLevel, shouldSave); | ||
} | ||
|
||
public override LogEntryEvent__e getLogEntryEvent() { | ||
return mockEvent != null ? mockEvent : super.getLogEntryEvent(); | ||
} | ||
|
||
public LogArchive__b getLogEntryArchive() { | ||
LogEntryEvent__e cachedEvent = this.getLogEntryEvent(); | ||
return new LogArchive__b( | ||
ApiVersion__c = cachedEvent.ApiVersion__c, | ||
DatabaseResultCollectionType__c = cachedEvent.DatabaseResultCollectionType__c, | ||
DatabaseResultJson__c = cachedEvent.DatabaseResultJson__c, | ||
DatabaseResultType__c = cachedEvent.DatabaseResultType__c, | ||
ExceptionMessage__c = cachedEvent.ExceptionMessage__c, | ||
ExceptionStackTrace__c = cachedEvent.ExceptionStackTrace__c, | ||
ExceptionType__c = cachedEvent.ExceptionType__c, | ||
LimitsAggregateQueriesMax__c = cachedEvent.LimitsAggregateQueriesMax__c, | ||
LimitsAggregateQueriesUsed__c = cachedEvent.LimitsAggregateQueriesUsed__c, | ||
LimitsAsyncCallsMax__c = cachedEvent.LimitsAsyncCallsMax__c, | ||
LimitsAsyncCallsUsed__c = cachedEvent.LimitsAsyncCallsUsed__c, | ||
LimitsCalloutsUsed__c = cachedEvent.LimitsCalloutsUsed__c, | ||
LimitsCpuTimeMax__c = cachedEvent.LimitsCpuTimeMax__c, | ||
LimitsCpuTimeUsed__c = cachedEvent.LimitsCpuTimeUsed__c, | ||
LimitsDmlRowsMax__c = cachedEvent.LimitsDmlRowsMax__c, | ||
LimitsDmlRowsUsed__c = cachedEvent.LimitsDmlRowsUsed__c, | ||
LimitsDmlStatementsMax__c = cachedEvent.LimitsDmlStatementsMax__c, | ||
LimitsDmlStatementsUsed__c = cachedEvent.LimitsDmlStatementsUsed__c, | ||
LimitsEmailInvocationsMax__c = cachedEvent.LimitsEmailInvocationsMax__c, | ||
LimitsEmailInvocationsUsed__c = cachedEvent.LimitsEmailInvocationsUsed__c, | ||
LimitsFutureCallsMax__c = cachedEvent.LimitsFutureCallsMax__c, | ||
LimitsFutureCallsUsed__c = cachedEvent.LimitsFutureCallsUsed__c, | ||
LimitsHeapSizeMax__c = cachedEvent.LimitsHeapSizeMax__c, | ||
LimitsHeapSizeUsed__c = cachedEvent.LimitsHeapSizeUsed__c, | ||
LimitsMobilePushApexCallsMax__c = cachedEvent.LimitsMobilePushApexCallsMax__c, | ||
LimitsMobilePushApexCallsUsed__c = cachedEvent.LimitsMobilePushApexCallsUsed__c, | ||
LimitsQueueableJobsMax__c = cachedEvent.LimitsQueueableJobsMax__c, | ||
LimitsQueueableJobsUsed__c = cachedEvent.LimitsQueueableJobsUsed__c, | ||
LimitsSoqlQueriesMax__c = cachedEvent.LimitsSoqlQueriesMax__c, | ||
LimitsSoqlQueriesUsed__c = cachedEvent.LimitsSoqlQueriesUsed__c, | ||
LimitsSoqlQueryLocatorRowsMax__c = cachedEvent.LimitsSoqlQueryLocatorRowsMax__c, | ||
LimitsSoqlQueryLocatorRowsUsed__c = cachedEvent.LimitsSoqlQueryLocatorRowsUsed__c, | ||
LimitsSoqlQueryRowsMax__c = cachedEvent.LimitsSoqlQueryRowsMax__c, | ||
LimitsSoqlQueryRowsUsed__c = cachedEvent.LimitsSoqlQueryRowsUsed__c, | ||
LimitsSoslSearchesMax__c = cachedEvent.LimitsSoslSearchesMax__c, | ||
LimitsSoslSearchesUsed__c = cachedEvent.LimitsSoslSearchesUsed__c, | ||
Locale__c = cachedEvent.Locale__c, | ||
LoggedBy__c = UserInfo.getUserId(), | ||
LoggedByString__c = UserInfo.getUserId(), | ||
LoggedByUsername__c = cachedEvent.LoggedByUsername__c, | ||
LoggingLevel__c = cachedEvent.LoggingLevel__c, | ||
LoggingLevelOrdinal__c = cachedEvent.LoggingLevelOrdinal__c, | ||
LoginApplication__c = cachedEvent.LoginApplication__c, | ||
LoginBrowser__c = cachedEvent.LoginBrowser__c, | ||
LoginHistoryId__c = cachedEvent.LoginHistoryId__c, | ||
LoginPlatform__c = cachedEvent.LoginPlatform__c, | ||
LoginType__c = cachedEvent.LoginType__c, | ||
LogoutUrl__c = cachedEvent.LogoutUrl__c, | ||
Message__c = cachedEvent.Message__c, | ||
NetworkId__c = cachedEvent.NetworkId__c, | ||
NetworkLoginUrl__c = cachedEvent.NetworkLoginUrl__c, | ||
NetworkLogoutUrl__c = cachedEvent.NetworkLogoutUrl__c, | ||
NetworkSelfRegistrationUrl__c = cachedEvent.NetworkSelfRegistrationUrl__c, | ||
NetworkUrlPathPrefix__c = cachedEvent.NetworkUrlPathPrefix__c, | ||
OrganizationDomainUrl__c = cachedEvent.OrganizationDomainUrl__c, | ||
OrganizationEnvironmentType__c = cachedEvent.OrganizationEnvironmentType__c, | ||
OrganizationId__c = cachedEvent.OrganizationId__c, | ||
OrganizationInstanceName__c = cachedEvent.OrganizationInstanceName__c, | ||
OrganizationName__c = cachedEvent.OrganizationName__c, | ||
OrganizationNamespacePrefix__c = cachedEvent.OrganizationNamespacePrefix__c, | ||
OrganizationType__c = cachedEvent.OrganizationType__c, | ||
OriginLocation__c = cachedEvent.OriginLocation__c, | ||
OriginType__c = cachedEvent.OriginType__c, | ||
ParentLogTransactionId__c = cachedEvent.ParentLogTransactionId__c, | ||
ProfileId__c = cachedEvent.ProfileId__c, | ||
ProfileName__c = cachedEvent.ProfileName__c, | ||
RecordCollectionType__c = cachedEvent.RecordCollectionType__c, | ||
RecordId__c = cachedEvent.RecordId__c, | ||
RecordJson__c = cachedEvent.RecordJson__c, | ||
RecordSObjectClassification__c = cachedEvent.RecordSObjectClassification__c, | ||
RecordSObjectType__c = cachedEvent.RecordSObjectType__c, | ||
RecordSObjectTypeNamespace__c = cachedEvent.RecordSObjectTypeNamespace__c, | ||
SessionId__c = cachedEvent.SessionId__c, | ||
SessionSecurityLevel__c = cachedEvent.SessionSecurityLevel__c, | ||
SessionType__c = cachedEvent.SessionType__c, | ||
SourceIp__c = cachedEvent.SourceIp__c, | ||
StackTrace__c = cachedEvent.StackTrace__c, | ||
SystemMode__c = cachedEvent.SystemMode__c, | ||
ThemeDisplayed__c = cachedEvent.ThemeDisplayed__c, | ||
Timestamp__c = cachedEvent.Timestamp__c, | ||
TimestampString__c = cachedEvent.TimestampString__c, | ||
TimeZoneId__c = cachedEvent.TimeZoneId__c, | ||
Topics__c = cachedEvent.Topics__c, | ||
TransactionEntryNumber__c = cachedEvent.TransactionEntryNumber__c, | ||
TransactionId__c = cachedEvent.TransactionId__c, | ||
TriggerOperationType__c = cachedEvent.TriggerOperationType__c, | ||
TriggerSObjectType__c = cachedEvent.TriggerSObjectType__c, | ||
UserLicenseDefinitionKey__c = cachedEvent.UserLicenseDefinitionKey__c, | ||
UserLicenseName__c = cachedEvent.UserLicenseName__c, | ||
UserLoggingLevel__c = cachedEvent.UserLoggingLevel__c, | ||
UserLoggingLevelOrdinal__c = cachedEvent.UserLoggingLevelOrdinal__c, | ||
UserRoleId__c = cachedEvent.UserRoleId__c, | ||
UserRoleName__c = cachedEvent.UserRoleName__c, | ||
UserType__c = cachedEvent.UserType__c | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
nebula-logger/main/logger-engine/classes/LogEntryArchiveBuilder.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>51.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
nebula-logger/main/logger-engine/objects/LogArchive__b/LogArchive__b.object-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<deploymentStatus>InDevelopment</deploymentStatus> | ||
<description>Big Object representation of Logger data. Can be used as a standalone archive, or in conjunction with platform events and the existing Log__c custom object.</description> | ||
<label>Log Archive</label> | ||
<pluralLabel>Log Archives</pluralLabel> | ||
</CustomObject> |
13 changes: 13 additions & 0 deletions
13
nebula-logger/main/logger-engine/objects/LogArchive__b/fields/ApiVersion__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>ApiVersion__c</fullName> | ||
<externalId>false</externalId> | ||
<isFilteringDisabled>false</isFilteringDisabled> | ||
<isNameField>false</isNameField> | ||
<isSortingDisabled>false</isSortingDisabled> | ||
<label>API Version</label> | ||
<length>5</length> | ||
<required>false</required> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
13 changes: 13 additions & 0 deletions
13
...logger-engine/objects/LogArchive__b/fields/DatabaseResultCollectionType__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>DatabaseResultCollectionType__c</fullName> | ||
<externalId>false</externalId> | ||
<isFilteringDisabled>false</isFilteringDisabled> | ||
<isNameField>false</isNameField> | ||
<isSortingDisabled>false</isSortingDisabled> | ||
<label>Database Result Collection Type</label> | ||
<length>255</length> | ||
<required>false</required> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
12 changes: 12 additions & 0 deletions
12
...gger/main/logger-engine/objects/LogArchive__b/fields/DatabaseResultJson__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>DatabaseResultJson__c</fullName> | ||
<externalId>false</externalId> | ||
<isFilteringDisabled>false</isFilteringDisabled> | ||
<isNameField>false</isNameField> | ||
<isSortingDisabled>false</isSortingDisabled> | ||
<label>Database Result JSON</label> | ||
<length>131072</length> | ||
<type>LongTextArea</type> | ||
<visibleLines>8</visibleLines> | ||
</CustomField> |
Oops, something went wrong.