ftos.logging.clearProperty
IMPORTANT!
Starting with v24.3.0, this is renamed from server.logging.clearProperty to ftos.logging.clearProperty.
Starting with v24.3.0, this is renamed from server.logging.clearProperty to ftos.logging.clearProperty.
Clears the value of a custom logging property.
This is a method suitable for all business service components modules.
Syntax
Copy
function ftos.logging.clearProperty(key: string): void
| Parameter | Description |
|---|---|
key
|
Custom log property key to be cleared. |
Examples
In this example:
- We clear the value of the fooKey custom logging property.
- We use the ftos.logging.getProperty function to store the key's value in the z variable.
- We use the zValue variable to store the state of the property.
- We ftos.logging.log a message that emphasizes the state of the fooKey custom property.
Copy
ftos.logging.clearProperty('fooKey');
var z = ftos.logging.getProperty('fooKey');
var zValue = z==null ? 'is not set.' : 'is set.';
log('The fooKey custom property ' + zValue);
The resulting log message will be similar to the one below:
Copy
-[START]---------------------------------------
Timestamp: 17/12/2021 02:11:21 PM
Message: The fooKey log property is not set.
Severity: Information
Exception:
Properties: { CorrelationId: "23cdb1f5-0529-4377-b200-399efb8bc32f", PortalProfile: null, MachineName: "FTOSBUCLP385", Language: "en-GB", Source: "Platform", automationscript: "sample-script-log-api" }
-[END]---------------------------------------