There is some sample code that comes with RSLogix on how to do it. It's been a while but I have played around with it at my desk. I wasn't logging data, just saving some recipes periodically. It may not be a good idea if you have to log frequently.
The sample had message instructions that would create directories, files and save the data to the file. You had to take all of the data you wanted to save and put it in a tag that was an array of 500 bytes (SINT), then it would write that array to the card. I think you could specify the number of bytes you wanted to write.