-
1. Re: Logging output manipulation after the logline creation
jamezp Apr 25, 2012 12:35 PM (in response to kristjan273)Do you just want to remove the stacktrace from being printed? If so, just remove the %E in the pattern.
-
2. Re: Logging output manipulation after the logline creation
kristjan273 Apr 25, 2012 9:30 PM (in response to jamezp)No, exactly as said, limit or filter out the stack trace. Something like http://nurkiewicz.blogspot.com/2012/03/filtering-irrelevant-stack-trace-lines.html .
I used to live with log4j %throwable{n}, but now I want move towards jboss logging framework.
-
3. Re: Logging output manipulation after the logline creation
jamezp Apr 25, 2012 10:07 PM (in response to kristjan273)1 of 1 people found this helpfulIt seems like %throwable{n} just prints n lines from the stack trace. It sounds more like you want a filter though. You could probably use the match filter along with a not filter.
This example will not print any message that contains JBAS or JNDI to the console:
<console-handler name="CONSOLE"> <level name="INFO"/> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> <filter> <not> <match pattern=".*JBAS"/> <match pattern=".*JNDI"/> </not> </filter> </console-handler>
Is that more what you're looking for?
-
4. Re: Logging output manipulation after the logline creation
kristjan273 Apr 26, 2012 4:30 AM (in response to jamezp)Yes, very close to what I want. Do you know an option to also limit the filtered stack to eq. 3 lines only?
And maybe, are you able to explain what other filter instructions do - like "all","any","accept","change-level","deny","level","level-range","match","not","replace". ?
Otherwise, tnx on the helpful answer!
-
5. Re: Logging output manipulation after the logline creation
jamezp Apr 26, 2012 10:24 AM (in response to kristjan273)There is no way to cut-down the stack trace. You can either print it or not.
There isn't much information on what the levels do. Well, there is some if you execute
/subsystem=logging/logger=*:read-resource-description
from CLI. Actually if you have AS 7 running you could run$JBOSS_HOME/bin/jboss-cli.sh --connect "/subsystem=logging/logger=*:read-resource-description" >> /home/user/somefile.txt
to write it out to a file. It's probably not the greatest documentation, but it could be useful. The documentation will be updated soon hopefully.