Personally, I think it can go both ways; however, I also (like many) feel they should always be optional. The story should above all convey all information to the player naturally through play, of course unless the point of the game is to find hidden information, then I can totally see this being a good way of achieving that.
In my game, I use a few of these. I use them mostly in the form of newspapers, to convey world news. I like writing little tidbits of lore, but again, it's not necessary in any way for the player to read them, as the story will provide the bulk of the game's lore. I also keep these very short (maybe 3-6 boxes total.)
Well, I see 2 main problems with books in game:
1. Walls of texts many might just skip cuz they are not really into reading.
2. No point in reading them, as they don't help the player to beat the game.
Some people read them despite of those points, cuz they apparently like them.
So, to make books attractive to the majority of players, I'd try to "eliminate" the reasons, why books would be skipped.
1.
Keep the texts rather short.
Maybe add some illustrations.
Be sure to devide them often enough -> structure that "wall".
=> it's a videogame, no need to make books according to how they are in reality.
2.
Make it so, that reading them actually can help the player, to beat the game.
NOT in form of upping variables by opening, cuz that's not reading.
As example: Place various NPCs into the world (or add dialogue options to different NPCs) where they are asking for specific infos.
Example: Bar woman wants to brew the local special cocktail and needs a specific Herb, but doesn't know where to obtain it.
-> Player has read before about that very special herb, said to grow underwater in a cave in that forest near that local town.
As the NPC doesnt give any hint on the location, the player only will find it if lucky or because he knew where to find it, after having it read in a book.
-> The player is able to get the herb, the bar woman needs.
-> He can help her out and be rewarded from that NPC.
To ensure even more, that certain tasks only can be completed after reading the books, switches can be used to make certain locations accessable.
Another example could be a hint on a magical item, dropped by a miniboss which can give a good stat boost to your weapon.
After reading the book, that place where the mini boss lives, becomes accessable.
To go even further - after beating the boss, player finds a note which teaches him to create certain items to boost his weapons.
There could be many ways, to make books actually useful.