This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Jsp and log4j priority control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp and log4j priority control" Watch "Jsp and log4j priority control" New topic
Author

Jsp and log4j priority control

Karl Krasnowsky
Ranch Hand

Joined: Jan 16, 2009
Posts: 97
Hello,
I came across a technique for utilizing the log4j logger within jsp scripts for providing diagnostic feedback.
I was hoping I could add, e.g.,


throughout my code for development level information and when ready for production, define the priority for the package to ERROR so such messages would no longer be logged without touching code. Seemed like a clean solution.
However, the priority rule doesn't seem to work with JSPs?
In order to determine the classpath for the compiled jsp I println out the this.getClass().getName() information of the jsp.
This came back as:
(cart being the class that was generated).

so I figured adding a rule like this:



would do the trick, but when set this way I still get debug level output. Is it possible to control the priority level logging of jsps? and if so, how?


[SCJP 6]
[SCBCD in process]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp and log4j priority control