• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using log4j in JSP

 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to understand what needs to be done if I want to use log4j in my JSP pages. I tried to do this below but nothing is being generated.
Could someone please advice whether I'm missing something?

1.) I have log4j.properties located inside WEB-INF/classes:
--------------------------------------

--------------------------------------

2.) In my JSP page, this is what I have:

--------------------------------------

--------------------------------------
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a problem in using log4j in another class say a Servlet? is it isolated down to just the JSP?
 
Joan Horta Tosas
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have defined loggers in the file for ClassA and ClassB, not for Application.
 
Gaurav Arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try


The name of the loggers are "ClassA" and "ClassB".
 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Do you have a problem in using log4j in another class say a Servlet?
> is it isolated down to just the JSP?
Just the JSP

> You have defined loggers in the file for ClassA and ClassB, not for
> Application.
Sorry, it supposed to be:


The JSP doesn't give any error but it doesn't seem to produce the log file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!