我有 log4j jdbcappender 配置如下:
<appender name="jdbcAppender" class="bean.CustomJdbcAppender">
<param name="jndiDataSource" value="myDS"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="INSERT INTO log_table (level, loc, msg) VALUES ( '%p','%C;%L', '%m' )"/>
</layout>
如何将用户名从 log4j 传递到数据库表?
谢谢