Tuesday, April 9, 2024

Logging API in drupal 9

\Drupal::logger('module_name')->critical(t('This is critical  @message_id', ['@message_id' => $link]));

\Drupal::logger('module_name')->notice('this is notice print in watchdoc=@link',['@link' => $link,]);

 \Drupal::logger('module_name')->alert('this is notice print in watchdoc=@link',['@link' => $link,]);

 \Drupal::logger('module_name')->warning('this is notice print in watchdoc=@link',['@link' => $link,]);

  \Drupal::logger('module_name')>info('this is notice print in watchdoc=@link',['@link' => $link,]);

 \Drupal::logger('module_name')->error(

'test1=@role&template_id=%template_id&&jsonData=%data', [ '@role' => 'multiple field', '%template_id' => '123', '%data' => 'render multiple field' ] );





No comments:

Post a Comment

If you have any problem please let me know.