Adding ability to set the log action in the constructor