Hi Cedric,
The rt_logging.h file is only used if you are logging data to a MAT-file. So it assumes the MAT-file logging option is checked. You can uncheck this option in the model properties of your Simulink model by navigating through Code Generation > Interface > Advanced parameters and uncheck MAT-file logging option.
From what I understand, you wish to convert your Simulink model to MATLAB code. There is no direct method of doing so. If you wish to proceed with mex file creation, you have to do some post processing on the generated C code to include an entry point mexFunction( ). Also, you may need to modify the generated code as it is derived from a deployment perspective.