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

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.

主站蜘蛛池模板: 澳门| 武平县| 安宁市| 吉安市| 苍南县| 庆阳市| 银川市| 宿松县| 新密市| 宁蒗| 河池市| 海口市| 垫江县| 三门县| 辰溪县| 黎川县| 大足县| 晋宁县| 胶南市| 九江县| 永仁县| 灌南县| 福海县| 阿克陶县| 永康市| 当涂县| 临安市| 双牌县| 北安市| 龙山县| 丰县| 南召县| 施秉县| 江陵县| 黎城县| 历史| 驻马店市| 疏勒县| 洪湖市| 萨迦县| 贡山|