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

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.

主站蜘蛛池模板: 紫云| 碌曲县| 鹿邑县| 仪征市| 昂仁县| 辽宁省| 信丰县| 辰溪县| 麦盖提县| 科尔| 武隆县| 灵宝市| 南澳县| 上林县| 梁山县| 景谷| 平果县| 临漳县| 兴安县| 澎湖县| 郴州市| 绥芬河市| 井研县| 乌什县| 建宁县| 黄浦区| 建湖县| 乾安县| 福海县| 梅河口市| 阜南县| 吉林省| 金华市| 克东县| 桑植县| 天长市| 丰台区| 民丰县| 安徽省| 河南省| 潞西市|