can you explain step by step how to use log4j in ejb module in Jboss7.1?

admin

Administrator
Staff member
can you give me please a step by step procedure to follow, in order to make log4j work on an ejb module?
the situation is this: i have my ejbmodule, which is using hibernate to perform some fetching tasks, and i want to log everything. I want to use log4j but i can not understand some steps of the others procedure described on the web like those from jboss.

Can you please tell me what i should do, step by step?

As far as i am:

<ul>
<li>I have got my configuration file (and i don't know where to put it)</li>
<li>I have got the log4j.jar (and i don't know where to place it)</li>
<li>I don't know how to initialize the log environment (i have an ejb session bean which on startup initializes hibernate, i would like one to initialize the logger)</li>
</ul>

Can anyone of you help me please?

Thanks in advance

EDIT:
thanks for the fist suggestion it might help but i don't undestand how others may have META-INF in the ear.
My project looks like 3 projects togheder:

<ul>
<li>MyprojectLogic (which contains the ejbmodules)</li>
<li>MyprojectLogicClient (which contains all the interfaces, it is the library to be given to the client)</li>
<li>MyprojectLogicEAR (which actually contains nothing, i did not get what is its purpose)</li>
</ul>

ANSWER: see below or check here <a href="http://javafortheweb.blogspot.it/2013/02/enabling-and-using-log4j-on-jboss-as-7.html" rel="nofollow">javafortheweb</a> or <a href="http://gauchoacomecable.wordpress.com/" rel="nofollow">blog</a>