Jboss AS7.1 Async Handlers over Custom Handlers
mantonec Apr 9, 2013 10:14 AMHello,
I've created a Custom Handler that extends PeriodicRotatingFileHandler and defined a category for it.
<custom-handler name="ACTIVATION" class="com.mycompany.CustomPeriodicFileHandler" module="com.mycompany.dffp.common"> <level name="DEBUG"/> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} | %X{logts} | %X{clientId} | %-5p | %X{tsoId} | %X{activityName} | %X{taskName} | %X{engineName} | %m%n"/> </formatter> <properties> <property name="fieldKey" value="activityName"/> <property name="fieldValue" value="ACTIVATION"/> <property name="filePath" value="/home/michele/tmp"/> <property name="outFile" value="ACTIVATION"/> <property name="suffixOutFile" value=".log"/> <property name="autoFlushValue" value="true"/> <property name="appendValue" value="true"/> <property name="logSuffix" value=".yyyy-MM-dd"/> </properties> </custom-handler> ... <logger category="com.mycompany.logger" use-parent-handlers="false"> <level name="DEBUG"/> <handlers> <handler name="ACTIVATION"/> </handlers> </logger>
All works fine but i want to take advantages of Async Handler in order to avoid business logic be affected by log's lags.
So i've changed the configuratios as follows
<async-handler name="DffpAsyncLogger"> <level name="ALL"/> <queue-length value="1024"/> <overflow-action value="block"/> <subhandlers> <handler name="ACTIVATION"/> </subhandlers> </async-handler> <custom-handler name="ACTIVATION" class="com.mycompany.CustomPeriodicFileHandler" module="com.mycompany.dffp.common"> ... no changes ... </custom-handler> <logger category="com.mycompany.logger" use-parent-handlers="false"> <level name="DEBUG"/> <handlers> <handler name="DffpAsyncLogger"/> </handlers> </logger>
Now i can't see my log neither in server logs neither in applicative logs.
Please, could someone give me a suggestion ?
Thanks a lot,
Michele