在 log4j 的 HTMLLayout 中获取更多信息

发布于 2024-11-27 13:35:49 字数 189 浏览 1 评论 0原文

我一直在使用 log4j 的 HTMLLayout 来获取 html 格式的日志。但是,它只允许 5 列。我想获取发出日志请求的方法的名称。有什么办法吗做到这一点?(我知道在 PatternLayout 中可以使用转换字符 M。但我不认为 HTMLLayout 存在该选项。

任何帮助赞赏

标记。

I have been using log4j 's HTMLLayout for getting logs in html format.However,it only allows 5 columns.I would like to get the name of method where the logging request was issued.Is there any way to do this?(I know it is possible in PatternLayout using Conversion character M.But I don't think that option exists for HTMLLayout.

Any help appreciated

mark.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美男兮 2024-12-04 13:35:49

HTMLLayout 无法做到这一点。但是您可以编写一个扩展 HTMLLayout 的 CustomHTMLLayout,以便您可以以指定的 HTML 格式获取日志。

There is no way doing this for HTMLLayout. But you could write a CustomHTMLLayout that extends HTMLLayout so that you can get log in your specified HTML format.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文