FAR 61.51(a), which cover the topic of Pilot Logbooks, states that:
Each person must document and record the following time in a manner acceptable to the Administrator:
(1) Training and aeronautical experience used to meet the requirements for a certificate, rating, or flight review of this part.
(2) The aeronautical experience required for meeting the recent flight experience requirements of this part.
The regulations phrasing, “in a manner acceptable to the Administrator” is not followed by a statement or regulation that deems electronic logbooks as being unacceptable for this purpose. Therefore, it is perfectly legal to maintain the required logbook information in the format of your choosing.
For further study on this topic, you may find Susan Parson's article, eLogbook Logistics: Considerations for Moving from Paper Log to Digital Log an interesting read. This was featured in the May/June 2016 edition of the FAA Safety Briefing publication.