logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "G.L. Grobe" <g...@grobe.net>
Subject making a wrapper for log4j
Date Tue, 04 Sep 2001 23:48:55 GMT
I'm trying to put a wrapper around the Logging so that I won't have to put log4j imports and
declarations all over my code. I've heard of other doing this but I'm not exactly sure how
so I was hoping I could get some pointers on what I've done so far.

Any help much appreciated.

package com.neuroquest.cais.log;

import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;

public class Logger extends Category {
   static Category cat;

   public Category getCat() {
      return cat;
   public Logger(String name) {
      try {
      catch (Exception e) {
         System.err.println("Could not open rtlog.properties");
      if (cat == null)
         cat = Category.getInstance(name);

View raw message