logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Walker" <r...@softsell.com>
Subject Re: Newbie in.help needed..(basics)
Date Fri, 06 Apr 2001 14:20:33 GMT
Basically, to change a class to use log4j implies the following 
amendments:

* include an import line for the log4j Category

* create at least one static category in your class for logging (we 
create two 'diag' and 'appl' to separate diagnostic versus 
application messages

* exchange your System.out... (or whatever you use) for cat.log 
statements

That's it ... you're in business.

When we looked at wrapper classes we realised that any we 
produced would degrade performance, and imply significantly 
larger changes to our classes. So wrappers won't necessarily 
make the transition simpler.

And if you decide you need to switch to a different logging platform, 
the route is easy:

* implement your own 'Category' which sends the output to your 
new logging package.

* import your new Category class instead of the log4j one - which 
would be a simple batch edit to your class sources

So again, any wrapper you produce would have to be pretty darned 
good to make moving logging packages easier than this!

-- Rob --

Send reply to:  	"LOG4J Users Mailing List" <log4j-user@jakarta.apache.org>
Date sent:      	Fri, 06 Apr 2001 21:37:13 +0800
From:           	Venkatesh Prakash Sambandam <vprakss@hpsgns1.sgp.hp.com>
To:             	LOG4J Users Mailing List <log4j-user@jakarta.apache.org>
Subject:        	Re: Newbie in.help needed..(basics)

> Sorry.. I am little lost on your explanation. I will better
> do little more explorations on my part. If you have more
> patience kindly explain.
> 
> Cheers
> VPrakash.S
> 
> 
> Rob Walker wrote:
> > 
> > We also considered this .... but when you look at the scope of
> > change if you want to move away:
> > 
> > * 1 import statement
> > * create your own version of Category to implement the new
> > interface to your new logging package
> > 
> > When you look at this, moving to a different package at a later date
> > is a pretty small deal.
> > 
> > I'd say concentrate you efforts in your Category naming hierarchy
> > since this is a pain to change later. Get this right, and log4J does a
> > fine job and would be easy to swap out later if you needed.
> > 
> > Just for info ... we're working with 2 category sets at the root of our
> > logging
> > 
> > DIAG.*          developer and/or diagnostics messages
> > 
> > APPL.*          application messages
> > 
> > Easy to control and filter.
> > 
> > -- Rob
> > 
> > Send reply to:          "LOG4J Users Mailing List" <log4j-user@jakarta.apache.org>
> > Date sent:              Fri, 06 Apr 2001 20:17:18 +0800
> > From:                   Venkatesh Prakash Sambandam <vprakss@hpsgns1.sgp.hp.com>
> > To:                     LOG4J Users Mailing List <log4j-user@jakarta.apache.org>
> > Subject:                Newbie in.help needed..(basics)
> > 
> > > Hi all,
> > >
> > > I have just started using Log4J and I have some basic doubts. If
> > > there are any docs. available kindly let me know.
> > >
> > > 1. I want to write a class which should accept the log calls from
> > > other classes and log. If tomorrow I wish to change the log API
> > > I should be changing only this class and not the other user
> > > classes. (its something like facade pattern)
> > >
> > > Is it possible ?
> > >
> > > Cheers
> > > VPrakash.S
> > >
> > >
> > > Thomas Siegers wrote:
> > > >
> > > > Hi everyone,
> > > >
> > > > this is my first mail to this list und I'm also new to LOG4J.
> > > > So please bear with me :-)
> > > >
> > > > I would like to send my logs to a table in a database .
> > > > Since there's no appender for this, my idea is to use
> > > > the SocketAppender and write a server which receives
> > > > the logs and stores them into the database.
> > > >
> > > > Is there a more 'direct' way to do that?
> > > > Has anyone an idea?
> > > >
> > > > Thanks, Thomas
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > >
> > > --
> > > --------------------------------------------------------------------
> > > Never tell people how to do things. Tell them what to do and they
> > > will surprise you with their ingenuity.
> > > --------------------------------------------------------------------
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> > >
> > 
> > SoftSell Business Systems, Ltd.
> > ' testing solutions for a changing world '
> > 
> > +44 (20) 7488 3470
> > www.softsell.com
> > robw@softsell.com
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 
> -- 
> --------------------------------------------------------------------
> Never tell people how to do things. Tell them what to do and they 
> will surprise you with their ingenuity.
> --------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 



SoftSell Business Systems, Ltd.
' testing solutions for a changing world '
 
+44 (20) 7488 3470
www.softsell.com
robw@softsell.com

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message