Documentation of the E2E Transaction Logger
The Module
| Syntax |
JS
| |
|---|---|---|
| Semantics | The module itself is an object of type TransactionLogger. | |
| Examples |
JS
You can use directly the module to trace transactions | |
TransactionLogger
constructor
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Creates an object of type TransactionLogger. | |
| Arguments | logPath | The path where the log files will be written. |
| Examples |
JS
| |
startTransaction
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the start of a transaction and return a Transaction object. | |
| Arguments | name | The name of the transaction. |
| Examples |
JS
| |
processLogger
| Syntax |
JS
| |
|---|---|---|
| Semantics | An object of type ProcessLogger. | |
| Examples |
JS
| |
ProcessLogger
constructor
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Creates an object of type ProcessLogger. | |
| Arguments | logPath | The path where the log files will be written. |
| Examples |
JS
| |
processStart
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the start of a process. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
eventName | The start event name. | |
| Examples |
JS
| |
processEnd
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the end of a process. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
eventName | The end event name. | |
| Examples |
JS
| |
processStateStart
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the start of a state. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
stateName | The state name. | |
| Examples |
JS
| |
processStateEnd
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the end of a state. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
stateName | The state name. | |
| Examples |
JS
| |
processChoice
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces a choice. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
gateway | The gateway name. | |
choice | The choice name. | |
| Examples |
JS
| |
processEvent
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces an event. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
eventName | The eventname. | |
| Examples |
JS
| |
processValueString
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces a value of a String type. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
key | The key. | |
value | The value | |
| Examples |
JS
| |
processValueFloat
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces a value of a Float type. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
key | The key. | |
value | The value | |
| Examples |
JS
| |
processValueDateTime
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces a value of a Date type. | |
| Arguments | processName | The name of the process. |
processId | The process id. | |
key | The key. | |
value | The value | |
| Examples |
JS
| |
Transaction
A Transaction object is returned by the startTransaction method of a TransactionLogger. It is then used to trace what happens inside the transaction using startIO or any ProcessLogger method. Using transactions to trace processes instead of a ProcessLogger directly allows you to correlate the process steps and IOs of these transactions.
end
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the end of a transaction. | |
| Arguments | state | The state of the transaction. It can be true or 'OK' for a success, false or 'ERROR' for a failed. Default: 'OK' |
| Examples |
JS
| |
startIO
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Trace the start of an IO call and return an IO object. | |
| Arguments | name | The name of the IO call |
domain | The domain of the IO call | |
system | The system of the IO call | |
| Examples |
JS
| |
IO
An IO object is returned by the startIO method of a Transaction. It is then used to trace the end of the IO call.
end
| Syntax |
NONE
| |
|---|---|---|
| Semantics | Traces the end of a IO call. | |
| Arguments | state | The state of the IO call. It can be true or 'OK' for a success, false or 'ERROR' for a failed. Default: 'OK' |
| Examples |
JS
| |
transactionLoggerMiddleware
A function that returns a middle ware which can be used with express. It will automatically start a transaction when a request arrives and end it when the response is sent. The Transaction object will be available in the request object as trx.
| Arguments | options | object |
|---|---|---|
| The path where the log files will be written. | |
| The name that should be given to the transactions. Can be a function taking the request and response as parameter and returning the name. By default the name will be the URL of the request. | |
| Examples |
JS
| |