from the writings of the Ben Ish Hai
"Know what is above you: a watchful eye and an attentive ear. And all your deeds are written in a book" [Pirkei Avot 2:1]
Which deeds are written in a book? If they are what the Divine eye and ear monitor, our Mishnah should have said: "A watchful eye and an attentive ear monitor all your deeds, which are then written in a book."
The Mishnah's "Book" contains a description of how we behave at home with family and servants, and how we treat friends and workers.
We would all like loyalty and respect from our family, workers, and friends. We expect them to do things for us faithfully, quckly, and well.
G-d wants the same of us. And we owe Him even more than a servant owes his master, for He gives us life, strength, intelligence, talent, health, livelihood and everything else we have.
On Judgment Day, a person's shortcomings in serving G-d will become painfully clear. Then, if he was angry and vengeful toward those who took his honour lightly, G-d will behave toward him the same way. Job therefore said: "If I despised the cause of my servant or maid when they argued with me, what will I do when G-d arises, and when He remembers, what will I answer him?" [Job 31:13-14]
That is why a person's behaviour toward others is recorded in a register. After the Heavenly Court judges him, his punishment will be adjusted, measure for measure, according to how strict or forgiving he was with his family and servants.