How to enable New Relic to show MuleSoft logs

How to enable New Relic to show MuleSoft Logs

Hi, @cath123.mary: You will need to follow the instructions here to forward logs from your MuleSoft server to New Relic: Enable log management in New Relic | New Relic Documentation.

I tried with the log API. (https://log-api.newrelic.com/log/v1). The response from the API is success. However I am not able toe see the log in New Relic.

Please advise if I use log API, do I need a java agent to be setup?

Thanks
Mary

No, if you call the Log API directly, you do not need to install any agent.

Can you please the code you used to call the API (with your API key removed)?

Hi Phil

Are you referring to the sample request I sent?

Request:

{

"message": "User 'Arul' logged in ODX",

"logtype": "accesslogs",

"service": "login-service",

"hostname": "login.example.com",

"severity": "LOW",

"eventType": "InsightsLogs",

"env": "API_UAT",

"messageId": "7238-8580565-84859-4858",

"muleAppName": "new-relic-insights-logging",

"CreationDate": "2021-06-08T10:22:33",

"payload": "payload",

"result": "Success",

"endpoint": "/api/findreservation"

}

Response: Status 202 Accepted

{

"requestId": "532465f1-0001-b000-0000-0179f8ed018f"

}

OK, and how did you send it?

Hi Phil
Following 2 methods:

  1. I have created an application in MuleSoft to call this API and send the request as post message.
    2.I used postman

Hi, @arul.elias: I just tried sending your request to my account using HTTPie:

http POST https://log-api.newrelic.com/log/v1 \
Content-Type:application/json X-License-Key:xxxxxxxxxx < data.json

I am able to see the log message in the query builder: