Write to watchdog in Drupal 8


\Drupal::logger('my_module')->error($message);

\Drupal::logger('my_module')->notice($message);