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
You can use the custom field feature to add custom fields to your logs.
12
12
13
-
## Register custom fields for SAP Application Logging
13
+
14
+
## Format and type transformation for SAP logging services
15
+
16
+
The library will automatically detect which logging service is bound to your app and will set the custom field format accordingly.
17
+
18
+
For local testing purposes you can enforce a specific format like this:
19
+
20
+
```js
21
+
log.setCustomFieldsFormat("application-logging");
22
+
// possible values: "disabled", "all", "application-logging", "cloud-logging", "default"
23
+
```
24
+
25
+
Alternatively, you can force the logging format by setting a configuration file as explained in [Custom Fields Format](/cf-nodejs-logging-support/configuration/custom-fields-format).
26
+
27
+
### SAP Application Logging
14
28
15
29
In case you want to use this library with SAP Application Logging Service you need to register your custom fields.
16
30
Please make sure to call the registration exactly once globally before logging any custom fields.
17
31
Registered fields will be indexed based on the order given by the provided field array.
18
32
33
+
Custom fields are converted and printed as string values independent of their original type.
Alternatively, you can force the logging format by setting a configuration file as explained in [Custom Fields Format](/cf-nodejs-logging-support/configuration/custom-fields-format).
57
+
## Adding customfields
38
58
39
59
In addition to logging messages as described in [Message Logs](/cf-nodejs-logging-support/general-usage/message-logs) you can attach custom fields as an object of key-value pairs as last parameter:
0 commit comments