Servers by jDrones

Arduino Pixhawk MAVLink messages save in onboard log?

Hey all,
I have following problem:
I have a rotary encoder which is communicating via SPI and I want to store this information at the data log for flight analysis. Therefore I have an arduino due connected to the sensors and a Pixhawk4.
So far, I was able to connect the Arduino with the Pixhawk via MAVLink (following the post of Juan Pedro: https://discuss.ardupilot.org/search?q=flash%20topic%3A25566).
I also used mavlink_msg_param_value to send some test data to the pixhawk (either if I am not sure if this is the right way of doing it). I am using MissionPlaner as GCS and in the Mavlink Inspector i am able to see my additional component and my inside PARAM_VALUE my test data.

Now to my question is:
Is their a possibility to store the sended MAVLink messages (and therefor also the sensor data) to the flashlog on the onboard Sd-card?

For me this would be a really nice solution because then I also could add even more custom sensors to the arduino ad store their data without the need of implementing new drivers in the firmware (which I am not able to, due to my bad programming skills :/…)
The other solution for me is to request all data from the pixhawk via MAVLink and store it on an addtional external sd-card on the arduino. Which seems to me like a huge work around…

Did anyone have an idea how to solve it? Thanks in advance!

(PS: Since I am quite new to ardupilot and programming in general I hope I did not messed up with terminology etc… )

Here I have a short sketch of the SetUp:
ArduinoPixhawkMavlink

Servers by jDrones