Who logs the flight hours for airline pilots?
At my outfit, both.

Pilots log their own hours in the logbooks and keep a rough mental track of hours flown to ensure compliance with Flight Time Limitation rules.

The airline will also log pilot hours to stay in accordance with FTL and compare rosters to actual hours flown. This also serves to create a legal record of who was flying the aircraft should that be required at a later date.

Many - including myself - use an electronic logbook that pulls the data from the airline, so no writing needs to be done.