This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To solve error() of Log4J

 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends, in the following code getting

Error: "The method error(Exception) is undefined for the type Logger"

added log4j-1.2.15.jar to "WEB-INF/lib" directory. how to solve this problem?




Thanks
Shashidhar
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add the jar file on your classpath ?
 
Paul Clapham
Sheriff
Posts: 21314
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Don't do that. You need to use the Logger class from log4j, not that Logger class.
 
sr shashidhar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:

Don't do that. You need to use the Logger class from log4j, not that Logger class.



Ok, Its worked after using

import org.apache.log4j.Logger;

Thanks
Shashidhar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic