Continuously log data from an oscilloscope
Streaming data constantly to a computer rather than using one long acquisition will most likely be easier to implement and makes use of a computers large available storage. Because you only need digital data a usb logic analyzer is probably the cheapest and easiest option. 

Couple of options come to mind:


Depending on your oscilloscope you should be able to stream data to a pc to analyze quickly enough so that your 50000 sample buffer never fills up. I would contact your scope manufacturer and read through the manual to see if this is possible and if so the best way to implement it. 
Use a data acquisition card from national instruments or some other company to continually acquire and analyze data. The benefit here is that you can use a program such as Labview to make set up and testing a bit easier if you don't have much programming experience. Make use of the digital logic pins, no need to use analog acquisition.
Use a usb logic analyzer. Cheap. Easy to implement. There might even be one out there that comes with software which can do the analysis you need out of the box.