Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

Log4j wrapper

Thread view: 
g_asi2 - 27 Nov 2006 14:57 GMT
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
Daniel Dyer - 27 Nov 2006 15:01 GMT
> Hello all,
>
[quoted text clipped - 4 lines]
> 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
[quoted text clipped - 5 lines]
> 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.

Signature

Daniel Dyer
http://www.dandyer.co.uk

rxreyn3@gmail.com - 28 Nov 2006 23:01 GMT
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

> Hello all,
>
[quoted text clipped - 17 lines]
> Thanks,
> Asi
_weijiang_@yahoo.com - 29 Nov 2006 00:46 GMT
Too complicated.

Try LimpidLog at http://www.acelet.com/limpidlog/index.html. You do not
need to hard-code any log statement. It is an open source program.

After you register the class in question, use SuperDebugger, at
http://www.acelet.com/super/SuperDebugger/index.html, to do source
level debugging. It is a GUI debugger, even allows you to step to the
previous line...

> Hello all,
>
[quoted text clipped - 17 lines]
> Thanks,
> Asi


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.