Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Using log4j in JSP

 
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:

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

--------------------------------------
 
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?
 
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.
 
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".
 
Smith Li
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.
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!