Fixed thread safety issue in CommandLogger