M Handa

+ Follow
since Mar 08, 2010
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by M Handa

Hi All,

I have an fsprovider set up with a configured input directory which is on a network share say /mnt/mhanda1 (Suppose mhanda1 is shared using smb on

I have specified an input suffix as .txt.

So whenever i put a file in /mnt/mhanda1 directory, my service action reads that file and prints out the contents of the file to the stdout.

Now the problem is, if for some reasons or the smb server running on that machine goes down, I want to use a backup server, which say is running on and is mounted on my file system on /mnt/mhanda2

Whenever i unmount /mnt/mhanda1 I get the following error in my server logs

Now I do not understand how I can catch this IOException in my fs-listener code, because it is being caught and dealt with in a layer which I think is beyond my control. So I do not understand how I would know when to use /mnt/mhanda2.

Any suggestions will be appreciated.
I have managed to fix it by reading some documentation on log4j for jboss.

All I had to do was to specify an appender per application group and inside each appender, I would have a filter chain.

So my log appender shall look like the following.

<appender name="A" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"></errorHandler>
<param name="Append" value="false"/>
<param name="File" value="${jboss.server.home.dir}/log/A.log"/>
<param name="Threshold" value="INFO"/>

<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>

<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="A1.esb"/>

<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="A2.esb"/>

<filter class="org.jboss.logging.filter.TCLFilter">
<param name="AcceptOnMatch" value="true"/>
<param name="DeployURL" value="A3.esb"/>

<filter class="org.apache.log4j.varia.DenyAllFilter"/>


and so on for Group B, which would have B1.esb, B2.esb and B3.esb.

I am trying to group logs of multiple related applications to a single log file.

For example I have 3 applications A1.esb, A2.esb, A3.esb.

I want all the logs from these 3 applications get logged to a single log file called A.log.

Similarly, I want B.log for B1.esb, B2.esb and B3.esb.

I am using log4j in JBoss application server.

I have tried to use TCLFilter but I only succeeded in getting individual applications logging to individual log files. As in, A1.esb logging to A1.log, A2.esb logging to A2.log and so on. But I couldn't figure out a way of grouping these loggings.