java - Filtering Exceptions On Log4J 1.X -
firstly must say, cannot change log4j.properties log4j.xml or cannot change log4j version 1.x 2.x due reasons. need ignore 3 exceptions fileappender did 2 exceptions stringfilter not work third one. exception , property file is:
07 apr 2017 | 11:45:26,499 | error | sfsworker:ext:1 | extensions | | exception com.smartfoxserver.v2.exceptions.sfsjoinroomexception: join error - room full: 19, zone: { zone: batak } - can't add user: ( user name: d354e22339937548abb52ec442eb4eb4, id: 3, priv: 0, sess: 88.253.243.151:33453 ) @ com.smartfoxserver.v2.api.sfsapi.joinroom(sfsapi.java:990)
my property is:
log4j.appender.fileappender.filter.1=org.apache.log4j.varia.stringmatchfilter log4j.appender.fileappender.filter.1.stringtomatch=force_update log4j.appender.fileappender.filter.1.acceptonmatch=false log4j.appender.fileappender.filter.2=org.apache.log4j.varia.stringmatchfilter log4j.appender.fileappender.filter.2.stringtomatch=regular_update log4j.appender.fileappender.filter.2.acceptonmatch=false log4j.appender.consoleappender.filter.3=org.apache.log4j.varia.stringmatchfilter log4j.appender.consoleappender.filter.3.stringtomatch=room%20is%20full log4j.appender.consoleappender.filter.3.acceptonmatch=false
i not want see exceptions contains "room full" on fileappender. how can it?
if can't change configuration of log4j think difficult.
you can see answers of question log4j stringtomatch in property file
properties files don't support filters. you'll have switch xml configuration.
but check log4j version works :
see comment answer https://stackoverflow.com/a/3960938/1811730
[edit]
sorry, did not read question correctly :-(
maybe problem %20
have tried without: log4j.appender.consoleappender.filter.3.stringtomatch=room full
Comments
Post a Comment