How to use Log4j from EJB in WebLogic?
Hello!I have a ejb-app that is deployed in a weblogic 8.13 like a exploded folder and not from a .ear-file (I do not think that matters)
My problem is that when I try to use Log4j I get nothing at all appended to the console. System.out.println works.
Since the code executes with out any problem I guess there must be some error with the log4j.properties. It looks like:
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
My exploded app looks like:
D:/EJBHOME/com/MyMDB.class
D:/EJBHOME/log4j.properties
I have also put the file log4j.properties the folder System.getProperty("user.dir")
But nothing gets printed to the console. Do you see the error?
My code looks like:
...
import org.apache.log4j.Logger;
public class ManagerMDB implements MessageDrivenBean, MessageListener
{
private static final Logger logger = Logger.getLogger(ManagerMDB.class);
public void onMessage(Message message)
{
logger.debug("Hello");
...
...
Best regards
Fredrik
