Hello ,
Well i guess in this implementation code which will use your logging code has to make call like this in order to log the messages: Logger logger = new Logger("xyz");
I think better way to implement could be like this Create a interface, which will contain method for logging
Does this makes sense ???? Anyway i have written the code in crude form below, please comment what do you think. Creating Interface
public void debug (Object message); public void debug (Object message, Throwable exception); public void info (Object message); public void info (Object message, Throwable exception); public void warn (Object message); public void warn (Object message, Throwable exception); public void error (Object message); public void error (Object message, Throwable exception); public void fatal (Object message); public void fatal (Object message, Throwable
exception);
Creating Wrapper class public class Log4JLogger implements Logger { // May be we can have Singleton class. public Log4JLogger() {
private void init() {
} }
--
"G.L. Grobe" wrote: 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; |
- making a wrapper for log4j G.L. Grobe
- Re: making a wrapper for log4j Naresh Sharma
- Re: making a wrapper for log4j Don Taylor