Change peerID to final to avoid accidentally associating log with another peer later.
Make all public methods in both classes synchronized.