Graylog offers a number of ways to send event data, see here.
Mendix works with at least three of them:
To have the logging data available in your app, so that you can send it to Graylog, you can use the Logging module from the appstore.