Move log creation to common.rb.