- Drupal 8 Module Development
- Daniel Sipos
- 191字
- 2021-07-02 15:45:20
Logging summary
In this first section, we saw how logging works in Drupal 8. Specifically, we covered few theories so that you understand a bit how things play together and you don't just mindlessly use the logger factory without actually having a clue what goes on under the hood.
As examples, we created our own logging channel, which allows us to inject it wherever we need without having to always go through the factory. We will use this channel going forward for the Hello World module. Additionally, we created our own logger implementation. It won't do much at the moment, except getting registered, but we will use it in the next section to send emails when errors get logged to the site.
Finally, we used the logging framework (and our channel) in our salutation configuration form to log a message whenever the form is submitted. In doing so, we also passed the message that was saved so that it also gets included in the log. This should already work with the database log so go ahead and save the configuration form and then check the logging UI for that information message.
- Hyper-V 2016 Best Practices
- JavaScript高效圖形編程
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- Software Testing using Visual Studio 2012
- C語言程序設計
- Java Web開發技術教程
- Unreal Engine 4 Shaders and Effects Cookbook
- 自然語言處理Python進階
- Creating Stunning Dashboards with QlikView
- jQuery炫酷應用實例集錦
- Python深度學習原理、算法與案例
- Django實戰:Python Web典型模塊與項目開發
- Java 9 Programming By Example
- 邊玩邊學Scratch3.0少兒趣味編程
- Learning TypeScript