- 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.
- 數(shù)據(jù)科學(xué)實(shí)戰(zhàn)手冊(R+Python)
- Developing Mobile Web ArcGIS Applications
- 認(rèn)識編程:以Python語言講透編程的本質(zhì)
- Java Web開發(fā)技術(shù)教程
- 3D少兒游戲編程(原書第2版)
- Scala程序員面試算法寶典
- 軟件品質(zhì)之完美管理:實(shí)戰(zhàn)經(jīng)典
- C++程序設(shè)計(jì)教程(第2版)
- Android高級開發(fā)實(shí)戰(zhàn):UI、NDK與安全
- Java多線程并發(fā)體系實(shí)戰(zhàn)(微課視頻版)
- Go Systems Programming
- Developer,Advocate!
- Practical Linux Security Cookbook
- 深度剖析ApacheDubbo核心技術(shù)內(nèi)幕
- Python數(shù)據(jù)科學(xué)實(shí)戰(zhàn)