Log4j 0.9.1

org.log4j.examples
Class MyCategory

java.lang.Object
  |
  +--org.log4j.Category
        |
        +--org.log4j.examples.MyCategory
All Implemented Interfaces:
AppenderAttachable

public class MyCategory
extends Category

A simple example showing Category sub-classing. It shows the minimum steps necessary to implement one's CategoryFactory and that sub-classes can follow the hiearchy See source code for more details.


Fields inherited from class org.log4j.Category
additive, DEFAULT_INIT_OVERRIDE_KEY, DEFAULT_PROPERTIES_FILE, disable, instanceFQN, name, parent, priority, resourceBundle
 
Constructor Summary
MyCategory(String name)
          Just calls the parent constuctor.
 
Method Summary
 void debug(String message)
          Overrides the standard debug method by appending " world" to each message.
static Category getInstance(String name)
          This method overrides Category.getInstance(java.lang.String) by supplying its own factory type as a parameter.
static void main(String[] args)
          This program will just print
 
Methods inherited from class org.log4j.Category
addAppender, assert, callAppenders, debug, debug, error, error, error, exists, getAdditivity, getAllAppenders, getAppender, getChainedPriority, getCurrentCategories, getInstance, getName, getPriority, getResourceBundle, getResourceBundleString, getRoot, getRootPriority, info, info, info, isDebugEnabled, isEnabledFor, isInfoEnabled, l7dlog, l7dlog, log, log, log, removeAllAppenders, removeAppender, removeAppender, setAdditivity, setPriority, setResourceBundle, setRootPriority, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyCategory

public MyCategory(String name)
Just calls the parent constuctor.
Method Detail

main

public static void main(String[] args)
This program will just print
DEBUG [main] some.cat - Hello world.
and exit.

debug

public void debug(String message)
Overrides the standard debug method by appending " world" to each message.
Overrides:
debug in class Category
Following copied from class: org.log4j.Category
Parameters:
message - string to write in the log file

getInstance

public static Category getInstance(String name)
This method overrides Category.getInstance(java.lang.String) by supplying its own factory type as a parameter.
Following copied from class: org.log4j.Category
Parameters:
name - The name of the category to retrieve.

Log4j 0.9.1

Please notify me about new log4j releases.