Last active
March 2, 2020 14:15
-
-
Save achraf-jeday/fae00ace9ce3ba335ebc47e577db68d2 to your computer and use it in GitHub Desktop.
Drupal 8: Log error messages programmatically in a custom module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Logs a notice | |
\Drupal::logger('my_module')->notice($message); | |
// Logs an error | |
\Drupal::logger('my_module')->error($message); | |
// Logs an info | |
\Drupal::logger('my_module')->info($message); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment