Log message size exceeded. Increase the max message size setting

Problem:

We are using message logging with in APIs & see below error in logs.

2016-06-25 20:32:44,162 org:xxxx env:xxx api:xxx-xxxx rev:1  Apigee-Main-3 ERROR MESSAGING.FLOW - AsyncExecutionStrategy$AsyncExecutionTask.logException() : Exception caught com.apigee.kernel.exceptions.spi.UncheckedException: Log message size exceeded. Increase the max message size setting   at com.apigee.filelogger.FileLogger.log(FileLogger.java:36) ~[file-logger-1.0.0.jar:na]   at com.apigee.messaging.runtime.destinations.FileDestination.log(FileDestination.java:72) ~[message-processor-1.0.0.jar:na]   at com.apigee.steps.messagelogging.MessageLogger.logToDestination(MessageLogger.java:119) ~[message-logging-1.0.0.jar:na]   at com.apigee.steps.messagelogging.MessageLogger.log(MessageLogger.java:91) ~[message-logging-1.0.0.jar:na]   at com.apigee.steps.messagelogging.MessageLogger.execute(MessageLogger.java:59) ~[message-logging-1.0.0.jar:na]   at com.apigee.messaging.runtime.steps.StepExecution.execute(StepExecution.java:136) ~[message-processor-1.0.0.jar:na]   at com.apigee.flow.execution.AsyncExecutionStrategy$AsyncExecutionTask.call(AsyncExecutionStrategy.java:95) [message-flow-1.0.0.jar:na]   at com.apigee.flow.execution.AsyncExecutionStrategy$AsyncExecutionTask.call(AsyncExecutionStrategy.java:65) [message-flow-1.0.0.jar:na]   at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_75]   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_75]   at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_75]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]   at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]

Message logging settings:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><MessageLogging  async="false" continueOnError="false" enabled="true" name="PostClientFlowAX">  <DisplayName>PostClientFlowAX</DisplayName>  <Properties/>  <BufferMessage>false</BufferMessage>  <File async="true">  <FileName>apiData.log</FileName>  <FileRotationOptions rotateFileOnStartup="true">  <MaxFileSizeInMB>50</MaxFileSizeInMB>  <MaxFilesToRetain>10</MaxFilesToRetain>  <RotationFrequency unit="day">1</RotationFrequency>  <FileRotationType>SIZE</FileRotationType>  </FileRotationOptions>  <FlushAfterEachWrite>true</FlushAfterEachWrite>  <Message>###### METADATA ###### : {logging.message}  </Message>  </File>  <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>  <logLevel>INFO</logLevel>  <NotificationIntervalInSec>0</NotificationIntervalInSec></MessageLogging>

Should I increase MaxFileSizeInMB configuration to higher value to fix the issue?

-Vinay

0 7 4,451
7 REPLIES 7

@vinay poreddy

The MessageLogging policy writes logged messages in memory to a buffer. The message logger reads messages from the buffer and then writes to the destination that you configure. Each destination has its own buffer.

If the write rate to the buffer increases beyond the read rate, the buffer overflows and logging will fail.

The error message that you have mentioned above is what you get when this happens.

If you have an on-premises deployment of Edge, locate the message-logging.properties on the Message Processor and use this solution:

Increase the max.log.message.size.in.kb property (default value = 128 KB) in the message-logging.properties file.

This is mentioned in the doc on Message Logging policy here

Is it at router or mp level? I modified from 128kb to 256kb but still see same error.

The error message is coming on the message processor logs and the message processor is the one where the logging policy is processed.

So, the property needs to be modified in the message processor. please increase it to 1024 and restart and see if the issue persists.

@Divya Achan, I am having the same issue. I located the message-logging.properties file on the Message Processor and the line max.log.message.size.in.kb is commented out. I uncommented the line and set the value to 1024 and restarted the Message Processor.

However after restarting the file gets reverted back and I can see that everything is commented and the values are set to default again.

Any info on what's going wrong would help.

Thanks,

Sudheesh

@sudheeshdamodaran Did you have a look at the documentation below? To configure Edge after installation, you need to use a combination of .properties files and Edge utilities.

http://docs.apigee.com/private-cloud/latest/how-configure-edge

@sudheeshdamodaran As Akash pointed out, if you are on Private Cloud version 16.01 or above, then you would have to make changes using the Code with Config feature.

The doc link in Akash's comments walks you through on how you can make this change using Code with Config

Thanks @Divya Achan and @Akash Prabhashankar.

I made the changes as per the docs shared by Akash, and it worked.