MessageLogging Policy write to file - creates empty file

Not applicable

Hi,

I have used MessageLogging policy in my PostClientFlow to log messages to a file ...I see the log file but not the message int it...The Files are empty can you please help

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging async="false" continueOnError="false" enabled="true" name="MessageLogging.LogServiceCalls">
<DisplayName>MessageLogging.LogServiceCalls</DisplayName>
<File>
<Message>This is a test message. Message id : {request.header.messageId}</Message>
<FileName>CRMApi.log</FileName>
<FileRotationOptions rotateFileOnStartup="true">
<FileRotationType>TIME_SIZE</FileRotationType>
<MaxFileSizeInMB>10</MaxFileSizeInMB>
<MaxFilesToRetain>10</MaxFilesToRetain>
<RotationFrequency unit="minute">10</RotationFrequency>
</FileRotationOptions>
</File>
<logLevel>INFO</logLevel>
</MessageLogging>

0 7 349
7 REPLIES 7

Not applicable

request.header scope is only the proxy request pipeline, maybe that is causing the issue as it is undefined. Can you try with dummy value and see if you see log messages? @Deepa

I have tried to put static data...but still the same...

Can you attach the trace? @Deepa

Im developing using the UI...I do see the AX and no errors as such...It is just that I don't see the message in the File created

I tried your policy with this <Message>This is a test message. Message id :</Message> on my instance and I can see the messages in the logs.

Not applicable

Make sure you are looking at the directory corresponding the the revision you are using.

Yes...we are looking into the right folder structure...when digging into the server logs

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Attempting to load ESAPI.properties via file I/O.
Attempting to load ESAPI.properties as resource file via file I/O.
Not found in 'org.owasp.esapi.resources' directory or file not readable: /opt/apigee/var/log/edge-message-processor/messagelogging/XXX/st/proxy-v1/3/MessageLogging.LogServiceCalls/ESAPI.properties
Not found in SystemResource Directory/resourceDirectory: .esapi/ESAPI.properties
Not found in 'user.home' (/opt/apigee) directory: /opt/apigee/esapi/ESAPI.properties
Loading ESAPI.properties via file I/O failed. Exception was: java.io.FileNotFoundException
Attempting to load ESAPI.properties via the classpath.
SUCCESSFULLY LOADED ESAPI.properties via the CLASSPATH from '/ (root)' using current thread context class loader!
Attempting to load validation.properties via file I/O.
Attempting to load validation.properties as resource file via file I/O.
Not found in 'org.owasp.esapi.resources' directory or file not readable: /opt/apigee/var/log/edge-message-processor/messagelogging/XXX/st/proxy-v1/3/MessageLogging.LogServiceCalls/validation.properties
Not found in SystemResource Directory/resourceDirectory: .esapi/validation.properties
Not found in 'user.home' (/opt/apigee) directory: /opt/apigee/esapi/validation.properties
Loading validation.properties via file I/O failed.

Is this cause for not writing into the file...? If so what is the solution

Thanks