What does the BufferMessage property in MessageLogging do?

Not applicable

What does the BufferMessage property in the MessageLogging policy do? I've been unable to find any documentation on this property. We use this policy to log different pieces of data and we're finding that this policy is breaking our response streaming functionality for large payloads. For the variables being used, none of these variables attempt to touch the payload so I'm at a loss in figuring out why this wasn't working. I've zeroed in on this property, but am unsure what it really does even though I think I may know.

<MessageLogging enabled="false" continueOnError="true" async="true" name="LogMessage">
	<FaultRules/>
	<Properties/>
	<BufferMessage>true</BufferMessage>
	<File async="true">
		<FileName>apiDataLog.log</FileName>
		<FileRotationOptions rotateFileOnStartup="false">
			<MaxFileSizeInMB>50</MaxFileSizeInMB>
			<MaxFilesToRetain>10</MaxFilesToRetain>
			<RotationFrequency unit="day">1</RotationFrequency>
			<FileRotationType>SIZE</FileRotationType>
		</FileRotationOptions>
		<FlushAfterEachWrite>true</FlushAfterEachWrite>
		<Message> Logging time = {system.time} | Timestamp = {system.timestamp} | Log Level = {logging.loglevel} | Environment = {environment.name} | API = {apiproxy.name} | ClientID = {client_id} | App = {developer.app.name} | Data = {logging.data}
		</Message>
	</File>
	<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</MessageLogging>

Solved Solved
0 2 361
1 ACCEPTED SOLUTION

Hi Mike,

There is some information on <BufferMessage>, but it's apparently hidden under the "Stream-enabled" sample tab of the MessageLogging policy doc -- not very helpful there.

If HTTP streaming is enabled for your proxy, request/response messages are not buffered. If you want to log content that requires the flow message to be parsed, then set BufferMessage to true. Hope this helps -- I'll make sure it's added to the docs.

For example:

<MessageLogging name="LogPolicy">
    <File>
        ....
        ....
    </File>
    <BufferMessage>true</BufferMessage>
</MessageLogging>

View solution in original post

2 REPLIES 2

Click the "Stream-enabled" tab under Samples

Doc says - "If HTTP streaming is enabled in an API proxy, neither request nor response messages will be buffered by processing pipeline. When you need to log parsed message content, set BufferMessage to true... "

Hi Mike,

There is some information on <BufferMessage>, but it's apparently hidden under the "Stream-enabled" sample tab of the MessageLogging policy doc -- not very helpful there.

If HTTP streaming is enabled for your proxy, request/response messages are not buffered. If you want to log content that requires the flow message to be parsed, then set BufferMessage to true. Hope this helps -- I'll make sure it's added to the docs.

For example:

<MessageLogging name="LogPolicy">
    <File>
        ....
        ....
    </File>
    <BufferMessage>true</BufferMessage>
</MessageLogging>