久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <i id='AovaJ'><tr id='AovaJ'><dt id='AovaJ'><q id='AovaJ'><span id='AovaJ'><b id='AovaJ'><form id='AovaJ'><ins id='AovaJ'></ins><ul id='AovaJ'></ul><sub id='AovaJ'></sub></form><legend id='AovaJ'></legend><bdo id='AovaJ'><pre id='AovaJ'><center id='AovaJ'></center></pre></bdo></b><th id='AovaJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AovaJ'><tfoot id='AovaJ'></tfoot><dl id='AovaJ'><fieldset id='AovaJ'></fieldset></dl></div>
        <bdo id='AovaJ'></bdo><ul id='AovaJ'></ul>
    2. <legend id='AovaJ'><style id='AovaJ'><dir id='AovaJ'><q id='AovaJ'></q></dir></style></legend>

      <tfoot id='AovaJ'></tfoot>

      <small id='AovaJ'></small><noframes id='AovaJ'>

      如何在 TestNG 報(bào)告中包含 Log4j2 消息

      How to include Log4j2 messages in TestNG reporting(如何在 TestNG 報(bào)告中包含 Log4j2 消息)
        <tbody id='03ZPH'></tbody>

        <small id='03ZPH'></small><noframes id='03ZPH'>

        <legend id='03ZPH'><style id='03ZPH'><dir id='03ZPH'><q id='03ZPH'></q></dir></style></legend>
        • <bdo id='03ZPH'></bdo><ul id='03ZPH'></ul>
          <i id='03ZPH'><tr id='03ZPH'><dt id='03ZPH'><q id='03ZPH'><span id='03ZPH'><b id='03ZPH'><form id='03ZPH'><ins id='03ZPH'></ins><ul id='03ZPH'></ul><sub id='03ZPH'></sub></form><legend id='03ZPH'></legend><bdo id='03ZPH'><pre id='03ZPH'><center id='03ZPH'></center></pre></bdo></b><th id='03ZPH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='03ZPH'><tfoot id='03ZPH'></tfoot><dl id='03ZPH'><fieldset id='03ZPH'></fieldset></dl></div>

            1. <tfoot id='03ZPH'></tfoot>

                本文介紹了如何在 TestNG 報(bào)告中包含 Log4j2 消息的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我希望在所有測(cè)試用例的 TestNG 報(bào)告中提供 Log4j2 日志記錄信息.

                I would like to have the Log4j2 logging information available in the TestNG reports for all of the test cases.

                TestNG 使用一個(gè)名為 Reporter.java 的特殊記錄器類,它跟蹤日志輸出并將其保存在其結(jié)果 XML 中.

                TestNG uses a special logger class called Reporter.java that keeps track of the log output and saves it in its results XML.

                在 log4j 中,可以簡(jiǎn)單地創(chuàng)建一個(gè)路由到 Reporter 并注冊(cè)它的 appender 實(shí)現(xiàn).

                In log4j it was possible to simply create an appender implementation that routes to Reporter and register it.

                使用 Log4j2 中的新 Logger API,很難找到有關(guān)如何完成此操作的信息.我有一些信息可以使用 Log4j 而不是使用 Log4j2 來完成.

                With the new Logger API in Log4j2 it has been difficult to find information on how to accomplish this. I have some information to get this done using Log4j but not with Log4j2.

                推薦答案

                據(jù)我所知,你只需要實(shí)現(xiàn)一個(gè)簡(jiǎn)單的 Appender.比如:

                From what I can tell you just need to implement a simple Appender. Something like:

                @Plugin(name="Reporter", category ="Core", elementType="appender", printObject=true)
                public class ReporterAppender extends AbstractAppender {
                
                    private ReporterAppender(final String name, final Layout layout) {
                        super(name, null, layout, false);
                    }
                
                    @Override
                    public void append(final LogEvent event) {
                        final Layout<? extends Serializable> layout = getLayout();
                        if (layout != null && layout instanceof AbstractStringLayout) {
                             Reporter.log(((AbstractStringLayout) layout).toSerializable(event));
                        } else {
                             Reporter.log(event.getMessage().getFormattedMessage();            }
                
                    @PluginFactory
                    public static ReporterAppender createAppender(
                        @PluginAttribute("name") @Required(message = "A name for the Appender must be specified") final String name,
                        @PluginElement("Layout") Layout<? extends Serializable> layout) {
                        return new ReporterAppender(name, layout);
                    }
                }
                

                這篇關(guān)于如何在 TestNG 報(bào)告中包含 Log4j2 消息的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How can I detect integer overflow on 32 bits int?(如何檢測(cè) 32 位 int 上的整數(shù)溢出?)
                Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                Inconsistent behavior on java#39;s ==(java的行為不一致==)
                Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲(chǔ)為 int?)
                <legend id='KLw8j'><style id='KLw8j'><dir id='KLw8j'><q id='KLw8j'></q></dir></style></legend>
                1. <i id='KLw8j'><tr id='KLw8j'><dt id='KLw8j'><q id='KLw8j'><span id='KLw8j'><b id='KLw8j'><form id='KLw8j'><ins id='KLw8j'></ins><ul id='KLw8j'></ul><sub id='KLw8j'></sub></form><legend id='KLw8j'></legend><bdo id='KLw8j'><pre id='KLw8j'><center id='KLw8j'></center></pre></bdo></b><th id='KLw8j'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KLw8j'><tfoot id='KLw8j'></tfoot><dl id='KLw8j'><fieldset id='KLw8j'></fieldset></dl></div>

                    <small id='KLw8j'></small><noframes id='KLw8j'>

                      <tbody id='KLw8j'></tbody>

                      <bdo id='KLw8j'></bdo><ul id='KLw8j'></ul>

                        • <tfoot id='KLw8j'></tfoot>
                          主站蜘蛛池模板: 中文字幕免费视频 | 欧美特级黄色 | 天天看天天操 | 日日日操| 免费观看黄色一级片 | 天天操夜夜爽 | 久久久久久高潮国产精品视 | 亚洲一区免费视频 | 伊人免费网 | 久久久久久久久久久久久久av | 少妇一区在线观看 | 91成人在线| 日韩精品一区中文字幕 | 日韩在线一区二区三区 | 久久极品 | 免费视频中文字幕 | 免费黄色片视频 | 超碰免费在 | 日韩在线精品强乱中文字幕 | 日本三级电影在线观看视频 | 一级免费在线视频 | 91麻豆精品一区二区三区 | 国产精品久久欧美久久一区 | 亚洲国产精品人人爽夜夜爽 | av在线亚洲天堂 | 在线亚洲电影 | 国产精品欧美一区喷水 | 国产精品日韩欧美一区二区三区 | 亚洲国产精品一区二区第一页 | 五月激情综合网 | 精品日本中文字幕 | 久久久久国产一区二区三区四区 | 亚洲欧美精品 | 日本中文字幕视频 | 91网在线观看 | 天天拍天天草 | 伊人春色在线观看 | 久久久高清 | 看一级毛片 | 尤物在线视频 | 在线观看国产视频 |