Log4J

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vikram Sharma
    New Member
    • Jul 2007
    • 3

    #1

    Log4J

    i am using Log4J.
    i am using XML Configuration file.
    priority level set to DEBUG

    It adds a lots of statements in the log.
    i just want that out of complete application it should log only those statements which are with particular class.
    in other words i want some kind of filter, which logs only those statements that belong to a particular class.
  • Vikram Sharma
    New Member
    • Jul 2007
    • 3

    #2
    How can we do this??

    Comment

    • sanghirc
      New Member
      • Jul 2007
      • 1

      #3
      I am assuming that for the classes where you want logging.

      private Logger logger = Logger.getLogge r(this.getClass ().getName());

      If you are more specific about what logs you are looking at, it is easier to figure out how to solve your problem.

      Also, if you want the log messages to be limited to a certain level, DEBUG, INFO, WARN, ERROR, FATAL you can change the log level in the xml file that log4j is using for configuration in the following way.

      <priority value ="warn" />

      Comment

      Working...