I have created a client that calls an EJB
by JNDI
. The EJB has logs (slf4j) that normally are printed to a log file. What I want to do when I run my client is to redirect ALL possible logs to the standard output.
I've tried with SimpleLogger. I added slf4-simple
dependency and if I add logs on my client, they are printed on console but not the logs of the EJB.
Client:
private static final Logger logger = LoggerFactory.getLogger("the EJB logger");
public static void main(String[] args) {
logger.debug("testing..."); // this log is shown on console
try {
Environment env = new Environment(); // weblogic.jndi.Environment
env.setProviderURL(EJB_HOST);
Context ctx = env.getInitialContext();
MyEjb ejb = (MyEjb) (ctx.lookup(EJB_JNDI));
ejb.foo(); // the logs of this method are not shown on console
} catch (NamingException) {
logger.error(e.getMessage(), e);
System.exit(2);
}
}