-
1. Re: EJB Client log4j warnings
darranl Dec 2, 2005 10:55 AM (in response to guitoon)1 - Do not cross post.
2 - You need to read the log4j documentation and look at how to configure applications for logging. -
2. Re: EJB Client log4j warnings
srikanthpragada Feb 3, 2006 12:40 PM (in response to guitoon)I am experiencing the same problem. Can any one provide details regarding how to surpress the warning message.
Thank you,
Srikanth. -
3. Re: EJB Client log4j warnings
dasariprasad Mar 4, 2006 6:50 AM (in response to guitoon)use in the class of client
import org.apache.log4j.*;
in code
static Logger logger;
in main
logger = Logger.getRootLogger();
logger.addAppender(new FileAppender(new HTMLLocator(),
"mylog1.log",true));
ensure all log related jars are available(use ant)
Prasad DTR -
4. Re: EJB Client log4j warnings
srikanthpragada Mar 20, 2006 12:30 PM (in response to guitoon)I solved the problem of Log4j warnings with the following code.
import java.rmi.RemoteException;
import java.util.Properties;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
import org.apache.log4j.*;
public class Client
{
private static final String JNDI_NAME = "st.hello";
static Logger logger;
public static void main(String[] args) throws Exception
{
logger = Logger.getRootLogger();
logger.addAppender(new FileAppender( new HTMLLayout(), "log.html",true));
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
h.put(Context.PROVIDER_URL, "localhost:1099");
h.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context ctx = new InitialContext(h);
HelloHome home = (HelloHome ) ctx.lookup(JNDI_NAME);
Hello hello = home.create();
System.out.println(hello.sayHello("Srikanth"));
}
}
It is writing the log into a HTML file called log.html.
P.Srikanth.