Log4j wrapper

G

g_asi2

Hello all,

I know it will sound a bit strange but I need a log4j wrapper.
I don't think it is realy useful, by my boss requires (although I tried
to convince him it is useless >:-(

The idea is to have a wrapper class which holds the entire log4j logic.
Every time a class needs to log it will use the wrapper.

I tried to write a singlethon wrapper, but I have encounter a problem.
What if I would like to log the place this logging occured? I want it
to be like the regular use of log4j where the class name and line is in
the log.
Another thing, I want to be able to determine the logging level in the
hierarchy.

Is it possible?
Does anyone familiar with such a wrapper?

Thanks,
Asi
 
D

Daniel Dyer

Hello all,

I know it will sound a bit strange but I need a log4j wrapper.
I don't think it is realy useful, by my boss requires (although I tried
to convince him it is useless >:-(

The idea is to have a wrapper class which holds the entire log4j logic.
Every time a class needs to log it will use the wrapper.

I'm tempted to ask why, but I'm not sure I want to know.
I tried to write a singlethon wrapper, but I have encounter a problem.
What if I would like to log the place this logging occured? I want it
to be like the regular use of log4j where the class name and line is in
the log.
Another thing, I want to be able to determine the logging level in the
hierarchy.

Is it possible?
Does anyone familiar with such a wrapper?

Are you aware of Commons Logging
(http://jakarta.apache.org/commons/logging/)? It is a wrapper around
Log4J or Sun's JDK logging, so that you can switch between them without
changing your code. In most cases it is utterly pointless (how often do
you need to switch logging APIs?) but it can be useful if you are
deploying code on multiple application servers that uses different logging
systems.

Dan.
 
R

rxreyn3

What is a logging level hierarchy? You mean the appenders you have
created and what the current level is for each appender? God I wish my
worst worries were logging hehe. Typical boss mentality :)

Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top