- Drupal 8 Module Development
- Daniel Sipos
- 192字
- 2021-07-02 12:22:43
Logging summary
In this first section, we saw how logging works in Drupal 8. Specifically, we covered a bit of theory so that you understand 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 always having to 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 the 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.
- Rust實戰
- 老“碼”識途
- Expert Android Programming
- Python機器學習:手把手教你掌握150個精彩案例(微課視頻版)
- Learning Unity 2D Game Development by Example
- 軟件供應鏈安全:源代碼缺陷實例剖析
- Python機器學習之金融風險管理
- Unity 2018 Augmented Reality Projects
- 從零開始學Selenium自動化測試:基于Python:視頻教學版
- 從零開始:C語言快速入門教程
- 高性能PHP 7
- 例說FPGA:可直接用于工程項目的第一手經驗
- 創新工場講AI課:從知識到實踐
- Enterprise Application Architecture with .NET Core
- Go語言編程之旅:一起用Go做項目