Skip to content

Commit 41738d8

Browse files
committed
Move readme from crm-platform-base
1 parent 05fd8de commit 41738d8

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/application-monitoring/README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@
22

33
## Application Log
44

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:
66

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)
822

923
| | |
1024
| ------- | --- |
@@ -13,29 +27,16 @@ Datamodellen ligger i pakken [platform-data-model](src/platform-data-model/READM
1327
| Flow ||
1428
| Trigger ||
1529

16-
## Hvordan ta i bruk
30+
````
1731
18-
Husk å angi teamet som er ansvarlig for funksjonaliteten som logges i LoggerUtility.
32+
## Dependencies
1933
20-
```java
21-
private LoggerUtility logger = new LoggerUtility(
22-
CRM_ApplicationDomain.Domain.PLATFORCE,
23-
'LoginFlow'
24-
);
25-
26-
logger.errorAndPublish('Error message');
27-
logger.warningAndPublish('Warning message');
28-
logger.infoAndPublish('Info message');
29-
```
30-
31-
## Avhengigheter
32-
33-
- [platform-datamodel](src/platform-data-model/feature-flag-custom-metadata) - datamodell
34+
- [platform-datamodel](src/platform-data-model/feature-flag-custom-metadata) - data model
3435
3536
```mermaid
3637
---
37-
title: Pakkeavhengigheter
38+
title: Package dependencies
3839
---
3940
graph TD
4041
application-monitoring --> platform-datamodel;
41-
```
42+
````

0 commit comments

Comments
 (0)