Each country has slightly different requirements! For the US, here is the FAA rule for it: https://www.ecfr.gov/current/title-14/chapter-I/subchapter-D...
A lot of people still use paper (and fill it in after landing each flight), but there are quite a few digital options on the market now. I use one called LogTen, which stores everything in a SQLite file behind the scenes which is what I used to make this.