not able to create log and view it

I am using MessageLogging policy from PostClientFlow, but I am not able to view it and also I am not able to write it in a log file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging name="ML-Error-Message-Logging" async="false" continueOnError="true" enabled="true">
    <DisplayName>ML-Error-Message Logging</DisplayName>
    <Syslog>
        <Message>{environment.name}</Message>
        <Host>10.0.0.1</Host>
        <Port>556</Port>
    </Syslog>
    <logLevel>INFO</logLevel>
</MessageLogging>

I am getting this policy executed from the trace but I am not able to view the logs when I check it from this url:

https://apimonitoring.enterprise.apigee.com/logs

Secondly, I need to generate a log file from a paid account, please guide me on the same.

this is the xml I used to write in a file, but I am not able to find the file :

<File>
        <Message>Organization:{organization.name};Proxy:{apiproxy.name};Envirnment:{environment.name} Authentication request failed for Club {request.content}.</Message>
        <FileName>test.log</FileName>
        <FileRotationOptions rotateFileOnStartup="true">
            <FileRotationType>TIME_SIZE</FileRotationType>
            <MaxFileSizeInMB>10</MaxFileSizeInMB>
            <MaxFilesToRetain>10</MaxFilesToRetain>
            <RotationFrequency unit="minute">10</RotationFrequency>
        </FileRotationOptions>
    </File>

Thanks in advance

Solved Solved
0 5 147
1 ACCEPTED SOLUTION

Please note that the file logging capability of the message logging policy is for Apigee On Premise.

As per, https://docs.apigee.com/api-platform/reference/policies/message-logging-policy

"File logging is supported only in Apigee Edge for Private Cloud deployments. It's not available in Edge cloud. However, Syslog is available in both Edge Cloud and Edge for Private Cloud."

With that said, what type of logs are you trying to pull? Are you after analytics data over APIs?

View solution in original post

5 REPLIES 5

Anyone has any idea how the logging works

in the xml content use <FileRotationType>SIZE</FileRotationType> or <FileRotationType>TIME</FileRotationType> based upon that, give the remaining values.

Modified the xml but not receiving any response, I shall be grateful if you give any working xml.

Below xml I am using:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging name="Common-Message-Logging-1" enabled="true" continueOnError="true" async="true">
    <DisplayName>ML-Common-Message Logging</DisplayName>
    <File>
        <Message>Organization:{organization.name};Proxy:{apiproxy.name};Envirnment:{environment.name} Authentication request for ClubId: {clubId}.</Message>
        <FileName>clubs-authenticate-v1.log</FileName>
        <FileRotationOptions rotateFileOnStartup="true">
            <FileRotationType>SIZE</FileRotationType>
            <MaxFileSizeInMB>10</MaxFileSizeInMB>
            <MaxFilesToRetain>10</MaxFilesToRetain>
        </FileRotationOptions>
    </File>
    <BufferMessage>true</BufferMessage>
    <logLevel>ALERT</logLevel>
</MessageLogging>

Please note that the file logging capability of the message logging policy is for Apigee On Premise.

As per, https://docs.apigee.com/api-platform/reference/policies/message-logging-policy

"File logging is supported only in Apigee Edge for Private Cloud deployments. It's not available in Edge cloud. However, Syslog is available in both Edge Cloud and Edge for Private Cloud."

With that said, what type of logs are you trying to pull? Are you after analytics data over APIs?

Thank you very much for your quick reply.

Even I tried with syslog also, but that logs are not available through this api

https://apimonitoring.enterprise.apigee.com/logs?org=<orgname>&env=<envname>;

Below is the xml for syslog, please correct me so that I can view the generated logs using above api. Also I have a paid account of Apigee (SAAS version, not on-premise)for my client project, there I want to implement the same for my production environment without any limitation.

<Syslog>
        <Message>Authentication complete for clubId: {request.queryparam.clubId}</Message>
        <!--<Host>logs-01.loggly.com</Host>-->
        <Port>514</Port>
        <Protocol>TCP</Protocol>
        <FormatMessage>true</FormatMessage>
    </Syslog>
    <logLevel>ALERT</logLevel>

Please help me, thanks in advance