You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/application-monitoring/README.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,23 @@
2
2
3
3
## Application Log
4
4
5
-
Logger rammeverk som publiserer logger til Application_Log\_\_c
5
+
This package contains an application logging framework that can be used for logging various events either på utilizing the _LoggerUtility_ apex class, or by generating _Application_Log\_\_c_ records via process builder, flow, workflow etc. The logger has four log levels: (Error, Warning, Info, Critical). It is highly recommended to also pass a _CRM_ApplicationDomain.Domain_ parameter, which defines which area of the application is both creating the log entry and is responsible for follow up. Calling the respective logger methods can be done as shown:
6
6
7
-
Datamodellen ligger i pakken [platform-data-model](src/platform-data-model/README.md)
7
+
```Apex
8
+
LoggerUtility logger = new LoggerUtility();
9
+
logger.Info('Message', SObjectRef, domain);
10
+
logger.Warning('Message', SObjectRef, domain);
11
+
logger.Error('Message', SObjectRef, domain);
12
+
logger.Critical('Message', SObjectRef, domain);
13
+
14
+
logger.Exception(ex, domain) //Used for logging catched exceptions
15
+
logger.publish();
16
+
```
17
+
18
+
The logger framework automatically adds the stacktrace, source function and source class to the log record when creating a log entry. To allow for application logging while also rolling back a transaction the framework includes also an _Application_Event\_\_e_ platform event counterpart that can be published even when rolling back transactions, _the standard publish() will generate a platform event_. Each log entry generates an unique UUID at runtime that can be handy for i.e. callouts requiring unique callout references in the callout chain. This examples returns the UUID of the last logged event:
19
+
`logger.peek().UUID__c`
20
+
21
+
The data model is available in [platform-data-model](src/platform-data-model/README.md)
8
22
9
23
|||
10
24
| ------- | --- |
@@ -13,29 +27,16 @@ Datamodellen ligger i pakken [platform-data-model](src/platform-data-model/READM
13
27
| Flow | ✅ |
14
28
| Trigger | ✅ |
15
29
16
-
## Hvordan ta i bruk
30
+
````
17
31
18
-
Husk å angi teamet som er ansvarlig for funksjonaliteten som logges i LoggerUtility.
0 commit comments