Make log provider idempotent

Added condition to log provider to prevent the resource from being
updated if the message wouldn't have been written to the log.

Added test to log_spec.rb to ensure this is the case.