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

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.

主站蜘蛛池模板: 汾阳市| 凤城市| 雷波县| 襄城县| 松江区| 彩票| 广南县| 肥西县| 虹口区| 镇平县| 抚顺县| 麻城市| 营口市| 双峰县| 昌吉市| 临邑县| 张掖市| 嵊州市| 独山县| 城步| 禹州市| 韶山市| 商河县| 庄浪县| 临夏市| 葵青区| 酒泉市| 德江县| 西林县| 南阳市| 繁峙县| 达尔| 柳林县| 同仁县| 富顺县| 望江县| 沁源县| 甘德县| 襄城县| 宣城市| 科技|