|
Hi,
I am trying to use logging feature in my
sample code using Cactus. The sample code goes like this:
import java.util.*;
import java.text.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; import java.io.*; import junit.framework.*; import org.apache.cactus.*; import org.apache.cactus.util.*; import org.apache.cactus.util.log.*; // For Logging public class TestJspTestCase extends JspTestCase
{
public TestJspTestCase(String theName)
{
super(theName); } public static void main(String[] theArgs)
{
junit.ui.TestRunner.main(new String[] {TestJspTestCase.class.getName()}); } public static Test suite()
{
return new TestSuite(TestJspTestCase.class); } public void testOut() throws IOException,
ServletException {
logger.debug("Beginning of testOut()"); // Logging Functionality session.setAttribute("name" , "BLUE" ) ; pageContext.forward("/hello.jsp"); logger.debug("End of testOut()"); // Logging functionality } public void endOut(HttpURLConnection huc
)throws IOException , ServletException {
System.out.println( AssertUtils.getResponseAsString(huc) ); } } The log_server.properties goes like
this:
log4j.appender.cactus = org.apache.log4j.FileAppender log4j.appender.cactus.File = cactus_server.log log4j.appender.cactus.Append = false log4j.appender.cactus.layout = org.apache.log4j.PatternLayout log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n log4j.category.org.apache.cactus = DEBUG, cactus log4j.category.my.package = DEBUG, cactus I add the the path to the log_server.properties to the classpath before adding the cactus.jar. This file is the there in D:\bea\wlserver6.0sp2\config\examples\serverclasses
When I run the sample by typing 'java TestJspTestCase' from D:\bea\wlserver6.0sp2\config\examples\clientclasses I get the following error in the java console log4j:ERROR No appenders could be found for category
(TestJspTestCase). </body> Can anybody tell me why I get this error?
|
- Re: log4J in Cactus Dharnidhar Vemuri
- Re: log4J in Cactus Vincent Massol
- Re: log4J in Cactus Dharnidhar Vemuri
- Re: log4J in Cactus Vincent Massol
- Re: log4J in Cactus Vincent Massol
- Fw: log4J in Cactus Dharnidhar Vemuri
- Re: log4J in Cactus Vincent Massol
