-
30. Re: TCLFilter
dmlloyd Dec 14, 2009 10:20 AM (in response to jaikiran)jaikiran wrote:
johk wrote:
Fantastic!
It's working now with the correct filter class.
Might I suggest that you update the wiki page to indicate that the TCLMCFilter works with jBoss 5.1.0? At present the only mention of it is under a section entitled 'JBoss AS 6.0'.
The wiki is open for edits for all community users. So if you are interested, then feel free to add how you got this working on 5.1.0 If not, i'll add something later today/tomorrow.
Also worth noting is that saying "AS 6.0" is not even correct. Starting with M2, the new jboss-logmanager is used instead of log4j, and the mechanism by which a separate log context is configured for a deployment is different (not filter-based). I'll look through the wiki pages to see what needs to be updated for this. -
31. Re: TCLFilter
jaikiran Dec 14, 2009 10:45 AM (in response to dmlloyd)david.lloyd@jboss.com wrote:
Also worth noting is that saying "AS 6.0" is not even correct. Starting with M2, the new jboss-logmanager is used instead of log4j, and the mechanism by which a separate log context is configured for a deployment is different (not filter-based). I'll look through the wiki pages to see what needs to be updated for this.
I updated the relevant sections to reflect this. It's here http://community.jboss.org/wiki/SeparatingApplicationLogs
-
32. Re: TCLFilter
dmlloyd Dec 14, 2009 10:46 AM (in response to jaikiran)jaikiran wrote:
david.lloyd@jboss.com wrote:
Also worth noting is that saying "AS 6.0" is not even correct. Starting with M2, the new jboss-logmanager is used instead of log4j, and the mechanism by which a separate log context is configured for a deployment is different (not filter-based). I'll look through the wiki pages to see what needs to be updated for this.
I updated the relevant sections to reflect this. It's here http://community.jboss.org/wiki/SeparatingApplicationLogs
Thanks Jaikiran!
-
33. Re: TCLFilter
sbommala Jan 12, 2010 6:39 PM (in response to jaikiran)Hello,
Can you please tell me what is that I am missing here? I replaced the following files under jboss-5.1.0.GA\lib
jboss-logging-jdk.jar
jboss-logging-log4j.jar
jboss-logging-spi.jar
with files from http://repository.jboss.org/maven2/org/jboss/logging/
<appender name="MYLOGFILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Append" value="true"/>
<param name="File" value="${jboss.server.home.dir}/log/appl.log"/>
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="Threshold" value="debug"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c{1}] %m%n"/>
</layout>
<filter class="org.jboss.logging.filter.TCLMCFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="appl.ear"/>
</filter>
</appender>I am using jdk1.6. The log appl.log is not getting created.
thanks
-
34. Re: TCLFilter
saava Mar 12, 2010 10:50 AM (in response to iksrazal)I copied jboss-logging-log4j.jar (2.1.1GA) version to JBOSS_HOME/lib directory and created appenders for my 2 wars. The log files get created but the filtering isn't happening..
log4j:ERROR Could not instantiate class [ org.jboss.logging.filter.TCLMCFilter].
java.lang.ClassNotFoundException: org.jboss.logging.filter.TCLMCFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.log4j.helpers.Loader.loadClass(Loader.java:178)
at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319)
at org.apache.log4j.xml.DOMConfigurator.parseFilters(DOMConfigurator.java:279)
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:200)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150)what am I missing..?
-
35. Re: TCLFilter
srirampv Apr 13, 2011 9:56 AM (in response to saava)Hi,
We are planning to use TCLFilter in Jboss 4.x to prevent logs being written into the server.log file of Jboss ( Currently our application logs are written into Server.log and this increases the size of the server.log). So, I would like to request senior members in this forum to comment, if there would be any performance hit /issue if we configure TCLFilter? Is it advisable to use TCLFilter to Filter out/Stop Unwanted logging into server.log in production based environments? Your replies would be highly appreciated.
Thanks in Advance
-
36. TCLFilter
wdfink Apr 13, 2011 10:34 AM (in response to srirampv)Hi,
I suppose it is better to open a new thread instead of reactivation such old one.
But nevertheless,
if your application should log in a seperate logfile you should add a category for your classes with its own appender.
A Filter will run inside a synchronized block of the appender and might have heavy lock contention during runtime under load.
Also it is a performance issue to prepare a logging (concat String .....) and throw it away, this will feed the GC also
-
37. Re: TCLFilter
dvarunkumar400 Dec 14, 2012 8:29 AM (in response to saava)Hi Even i am facing the same problem ... have u got the solution..
-
38. Re: TCLFilter
dvarunkumar400 Dec 20, 2012 10:18 AM (in response to dvarunkumar400)Hey i got solution, We have to go for TCLMCFilter for Jboss 5.1.0 and we have replace 3 jboss file to version 2.1.1.
-
39. Re: TCLFilter
arnabsarkar Feb 3, 2013 10:23 AM (in response to wdfink)Few important suggestion to make TCLFilter in JBOSS4.2
1. No need to add any external jars under JBOSS. This filter is present in jboss-common.jar already
2. If you want to separate server log from
application specific logs then write as below. Remember don't put application war file name directly since at runtimeJBOSS wouldn’t find lpc.war (my application war file name) rather it will converted into lpc-exp.war under temp folder. So we need to put url value as lpc-exp.war. and
AcceptOnMatch as false
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/server.log"/>
………..
…………
<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="false"/>
<param name="DeployURL" value="lpc-exp.war"/>
</filter>
</appender>
3
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/lpc.log"/>
………..
…………
<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="lpc-exp.war"/>
</filter>
</appender>
4. If you have multiple war under same joss instance then use like.....
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/lpc.log"/>
………..
…………
<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="lpc-exp.war"/>
</filter>
<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="false"/>
<param name="DeployURL" value="ab-exp.war"/>
</filter>
</appender>
5. If still it does not work then put below line also
<filter class="org.apache.log4j.varia.DenyAllFilter"></filter>