WSO2 Carbon log4j自定义appender

时间:2016-10-06 02:39:39

标签: log4j wso2 wso2carbon wso2-am

我编写了自定义log4j appender,用于将日志从WSO2 AM 1.10.0发送到RabbitMQ。如果我将自定义appender添加到WSO2 AM服务器,则会出现异常。

log appender error

使用appender的步骤:

  1. 创建一个包含所有依赖项的maven jar包,并将jar文件放到lib文件夹中, lib folder

  2. 修改\ repository \ conf,

  3. 下的log4j.properties

    log4j properties

    我很确定appender本身运行良好,因为它已经在一些应用程序中用于将日志发送到队列。

    appender code

    pom file

    有人可以告诉我如何正确实现WSO2的自定义log4j appender吗?

    提前致谢, 肖恩

1 个答案:

答案 0 :(得分:0)

这似乎是一个类加载问题。我认为这是因为WSO2服务器和您的自定义jar都包含log4j类。为slf4j依赖项设置范围<?php foreach ($rows as $row) { ?> <tr> <td><?php echo $i++;?></td> <td><?php echo $row->orderid;?></td> <td><?php echo $row->order_date;?></td> <td><?php echo $row->name;?></td> <td><?php echo $row->price;?></td> <td> <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal-<?= $row->customerid?>">View Details</button> </td> </tr> <div class="modal fade" id="myModal-<?= $row->customerid?>" role="dialog"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Order Details</h4> </div> <div class="modal-body"> <p><strong>Product Name</strong>:&nbsp;&nbsp;&nbsp;<?php echo $row->name;?></p> <p><strong>Quantity</strong>:&nbsp;&nbsp;&nbsp;<?php echo $row->quantity;?></p> <p><strong>Price</strong>:&nbsp;&nbsp;&nbsp;<?php echo $row->price;?></p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <?php } ?> ,如下所示,看看它是否有效。

Select countries.name as country, states.name as sta from countries left join cities on states.id= cities.state_id where states.country_id in (SELECT countries.id FROM countries where countries.name='India')