Message Logging - Javascript

Not applicable

Hi,

I am using MessageLogging policy in the PostClientFlow.

My requirement is to construct the message to log dynamically using JavaScript , adding it to a Variable and using that variable in the MessageLogging Policy.

Used JavaScript policy in the PostFlow.

But when I check the trace after the JavaScript policy I see the Variable valued but the same Variable is empty when it reaches the postClientFlow.

Can you let me know

Message Logging

<MessageLogging async="false" continueOnError="false" enabled="true" name="MessageLogging.LogServiceCalls">
  <DisplayName>MessageLogging.LogServiceCalls</DisplayName>
  <File>
    <Message defaultVariableValue="unknown">{postClientFlow.messageLogging.message}</Message>
    <FileName>Api.log</FileName>
    <FileRotationOptions rotateFileOnStartup="true">
      <FileRotationType>TIME_SIZE</FileRotationType>
      <MaxFileSizeInMB>1024</MaxFileSizeInMB>
      <MaxFilesToRetain>10</MaxFilesToRetain>
      <!--<RotationFrequency unit="minute">600</RotationFrequency>-->
    </FileRotationOptions>
  </File>
  <logLevel>ERROR</logLevel>
</MessageLogging>
0 5 521
5 REPLIES 5

Hi. I think your question makes sense. Did you ever reach a solution?

No I have not been able to achieve it...

I've tried this, and it works for me. Can you post your code, what you tried?

Hi Dino,

Thanks for coming back...I have created a simple API to just show you what I have done in the actual API

I have printed the string in the javascript and do see it in the Output log in trace view..but dont see it in the actual API log written in the server

Thanks

js-messagelogging.zip

Not applicable

Hi Dino,

Thanks for coming back...I have created a simple API to just show you what I have done in the actual API

js-messagelogging.zip

I have printed the string in the javascript and do see it in the Output log in trace view..but dont see it in the actual API log written in the server

Thanks