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

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.

主站蜘蛛池模板: 东安县| 大名县| 昂仁县| 彩票| 专栏| 从江县| 大荔县| 客服| 西畴县| 晋城| 高青县| 东丽区| 冕宁县| 阜城县| 大悟县| 嘉义市| 平昌县| 张家口市| 曲松县| 永丰县| 丽水市| 铁力市| 黄龙县| 云龙县| 莒南县| 揭西县| 久治县| 申扎县| 如东县| 蒲城县| 中牟县| 永仁县| 门源| 定南县| 鹤庆县| 萨嘎县| 贵德县| 响水县| 郴州市| 珠海市| 红河县|