在 log4j 的 HTMLLayout 中获取更多信息
我一直在使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.