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

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.

主站蜘蛛池模板: 邛崃市| 抚远县| 上饶县| 天台县| 浏阳市| 惠东县| 钟山县| 香港| 上蔡县| 兰州市| 墨竹工卡县| 红桥区| 明星| 包头市| 淳安县| 扎鲁特旗| 庐江县| 姚安县| 永平县| 内黄县| 集贤县| 读书| 阳山县| 邵阳县| 彩票| 新化县| 丰台区| 江北区| 阿荣旗| 利津县| 景宁| 雅江县| 洛南县| 松阳县| 沙湾县| 淮南市| 灵山县| 门源| 星子县| 柘荣县| 岑溪市|