how to log dump1090 output to file on pi?

Virtual Radar Server might do the things you need. It will keep a database with all the statistics. You can select periods, plane registrations, plane models, plane operators and more.