官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 嘉荫县| 邯郸县| 平泉县| 济宁市| 县级市| 寻乌县| 湖北省| 伊春市| 阳曲县| 澜沧| 威信县| 西丰县| 乌鲁木齐县| 临潭县| 石阡县| 文成县| 皋兰县| 库伦旗| 东莞市| 长泰县| 保靖县| 石家庄市| 什邡市| 喀喇沁旗| 陕西省| 三河市| 高淳县| 洞头县| 湖口县| 栾川县| 海口市| 北碚区| 防城港市| 赫章县| 宜章县| 麦盖提县| 连城县| 盘山县| 江城| 新兴县| 铜陵市|