Not able to see logs created by MessageLogging policy

Not applicable

I am facing an issue in MessageLogging policy for syslog with local destination

For local as Log destination, my messagelogging policy is,

<MessageLogging name="Message-Logging-1">
  <DisplayName>Message Logging 1</DisplayName>
  <Syslog>
    <Message>Message.id = {request.queryparam.w}</Message>
  </Syslog>
</MessageLogging>

In the On-Premises Edge installation, The

/opt/apigee4/conf/apigee/message-processor/message-logging.properties file contains,

log.root.dir=/opt/apigee4/var/log/messages

#max.log.message.size.in.kb=128 
#max.pending.write.size.in.mb=4 
#max.write.delay.seconds=30

Under /opt/apigee4/var/log,I created a folder named messages and restarted.But when the transaction happens,I am not seeing any logs getting updated here.

But,when I am switching on trace,I seeing details as below in /opt/apigee4/var/log/apigee/message-processor/logs/system.log.These are only trace log info I believe.

2015-10-19 05:41:32,014 org: env: Apigee-Main-7 INFO DEBUG.MASK - DebugMaskDataUtil.getMaskDataConfigurationBeanFromRepo() : DebugMaskDataConfigurationBean not available for Path : /organizations/digital/apiproxies/loggingtest/maskconfigs/default . Returning empty DebugMaskDataConfigurationBea

Why Syslog info not getting updated in the local path given under log.root.dir as well as in thismessage-processor/logs/system.log ?

Solved Solved
1 2 456
1 ACCEPTED SOLUTION

Hi @RadhamaniRamadoss

Please see the documentation page for the MessageLogging policy here.

According to your post you are expecting to see local log files. However, the configuration of the policy shows Syslog. The correct configuration of a MessageLogging policy for local logfile logging is something like the following:

<MessageLogging name='MessageLogging-1'>
   <File>
        <Message>{system.time},{request.path},{response.status.code}
</Message>
        <FileName>Radhamani-info.log</FileName>
        <FileRotationOptions rotateFileOnStartup='true'>
            <FileRotationType>SIZE</FileRotationType>
            <MaxFileSizeInMB>10</MaxFileSizeInMB>
            <MaxFilesToRetain>10</MaxFilesToRetain>
        </FileRotationOptions>
    </File>
</MessageLogging>

Notice that you have used a <Syslog> element. This tells Edge to send log messages to a syslog server, not to a local log file. The properties file you edited is not being used, because you are not specifying the File element.

Separately, I think it is a problem that Edge silently accepts your configuration. The Syslog configuration requires a host and port, at a minimum. You provided neither. I believe Edge should flag that as an invalid configuration for the policy, and should let you know. I've asked the Engineers to change the behavior of the platform to be more strict about that.

Had you seen such an error message, you may have realized your configuration mistake earlier, on your own.

View solution in original post

2 REPLIES 2

Hi @RadhamaniRamadoss

Please see the documentation page for the MessageLogging policy here.

According to your post you are expecting to see local log files. However, the configuration of the policy shows Syslog. The correct configuration of a MessageLogging policy for local logfile logging is something like the following:

<MessageLogging name='MessageLogging-1'>
   <File>
        <Message>{system.time},{request.path},{response.status.code}
</Message>
        <FileName>Radhamani-info.log</FileName>
        <FileRotationOptions rotateFileOnStartup='true'>
            <FileRotationType>SIZE</FileRotationType>
            <MaxFileSizeInMB>10</MaxFileSizeInMB>
            <MaxFilesToRetain>10</MaxFilesToRetain>
        </FileRotationOptions>
    </File>
</MessageLogging>

Notice that you have used a <Syslog> element. This tells Edge to send log messages to a syslog server, not to a local log file. The properties file you edited is not being used, because you are not specifying the File element.

Separately, I think it is a problem that Edge silently accepts your configuration. The Syslog configuration requires a host and port, at a minimum. You provided neither. I believe Edge should flag that as an invalid configuration for the policy, and should let you know. I've asked the Engineers to change the behavior of the platform to be more strict about that.

Had you seen such an error message, you may have realized your configuration mistake earlier, on your own.

Thankyou..Using File logging is working fine.

I have set log.root.dir=/opt/apigee4/var/log/messages.

And I am able to see the log file under the path getting updated ,

/opt/apigee4/var/log/messages/messagelogging/digital/test/loggingtest/1/MessageLogging-1

As per http://apigee.com/docs/api-services/reference/message-logging-policy,"The hostname or IP address of the server where the syslog should be sent. If you don't include this element, the default is localhost.".

So,as I mentioned above for <Syslog> ,if we dont mention hostname and port,then syslog should be logged in localhost.

<Syslog>

<Message>Message.id = {request.queryparam.w}</Message>

</Syslog>

What is the localhost path where I can see this syslog?Please clarify if this understanding is wrong.