Hi,
I have a couple of questions wrt to the Message Logging Policy.
I created a policy that will log on Errors, but I am struggling to get any decent info out of the message logs. Below is the policy which I created so far.
So my issues I am getting is the following:
Message Logging Policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging name="ML-LogPolicy">
<File>
<Message>Error Code: {message.status.code} || Error Content: {error.transport.message} || Error Message: {error.reason.phrase} || {request.header.x-api-key.values} || {request.header.content-type.values}"
"</Message>
<FileName>test2.log</FileName>
<FileRotationOptions rotateFileOnStartup="true">
<FileRotationType>TIME_SIZE</FileRotationType>
<MaxFileSizeInMB>10</MaxFileSizeInMB>
<MaxFilesToRetain>10</MaxFilesToRetain>
<!--RotationFrequency unit="minute">10</RotationFrequency-->
</FileRotationOptions>
</File>
<logLevel>ERROR</logLevel>
</MessageLogging>
Hi Etienne,
I hope you are using message logging policy in the postclientflow where it should be invoked in every request.
For errors, you might can use below flow variables too :-
Other than this you can extract error code or description from target calls and assign the same to custom variables for logging purpose.
For File rotation, you can use <FileRotationType>SIZE</FileRotationType> which will rotate the file only after the file size provided <MaxFileSizeInMB>10</MaxFileSizeInMB>
Hope it helps!!
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |