Mac: iTunes is great at keeping track of how many times you play a song, but there's not much more to it than that. If you want to track the songs you listen to — like a private version of Last.fm — Heard is a Mac app that does just that.
Heard runs quietly in your menubar, logs the songs you listen to throughout the day and saves the data in a JSON file. It keeps data on the artist name, song, album and track length. What you do with this data is up to you, but you can create interesting visualisations with Raphael or D3js to get a better idea of what you're listening to throughout the day. If nothing else, it's a handy way to keep an eye on the music you're listening to.