You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by John Volkar <jv...@etransport.com> on 2001/01/23 13:56:08 UTC

Log4j as "Source-Code Level" or "Compiled (black-box) Component" Reuse?

Branched from "RE: DOMConfigurator.configureAndWatch w/multiple async
appenders"

Ceki/All,
How do you see most people making use of the log4j package?  I mean, I want
to treat it as a 3rd party black-box that I just make use of as-is.  While I
can of course make changes to the framework and recompile it (to achieve
effects like .resetConfiguration() begin called via the PropertyWatchdog)
this seems to go against the block-box type of reuse that I (in my head)
seem to desire?

So, I'm curious, of the two styles of reuse, what are folks doing?

"Source-Code Level" - Just include the source code in your project, and make
tweaks as desired (and do more work to upgrade to new versions as needed.)

-or-

"Compiled (black-box) Component" - Use the compiled framework as a lib for
your project, and limit customization to the framework provided extension
points (and drop-in replacement upgrade whenever desired, and only do some
work when the framework breaks backwards compatibility.)

Poll results:
"Source-Code Level"................ 0
"Compiled (black-box) Component"... 1

Regards

John Volkar


Re: Newbie question

Posted by Ceki Gülcü <cg...@urbanet.ch>.
At 11:15 23.01.2001 -0800, you wrote:
>Hello,
>
>I've just started to look at log4j, and have a couple of questions:
>
>1. Is is possible to have different appenders that gets invoked for
>different priorities only?
>For example, I set the priority for the category to be INFO. Then, if for
>INFO logging I would like to log to a specific appender only, and for ERROR
>logging I would like to log to another appender only.

Roger,

See the Threshold option in AppenderSkeleton. BTW, this is already FAQ item.

>2. How would I enable the logging to a JMS topic? I assume I have to
>implement the Appender interface?

Log4j comes with a JMSAppender already.

>Thank you for contributing with such a cool tool!!

Thank you for thanking, :-) Ceki

----
Ceki Gülcü (cgu@urbanet.ch)


Re: JDBCAppender

Posted by Kevin Steppe <ks...@pacbell.net>.
I'll try to get it out by the end of this week.  I need to test it a little bit
more.

Kevin


Liu Xiao Hua wrote:

> Kevin:
>
> I am also very interested in the JDBCAppender, Where can I get it?
>
> Thanks a lot!
>
> Liu Xiaohua
>
> -----Original Message-----
> From: Kevin Steppe [mailto:ksteppe@pacbell.net]
> Sent: Wednesday, January 24, 2001 2:34 AM
> To: LOG4J Users Mailing List
> Subject: Re: Log4j as "Source-Code Level" or "Compiled (black-box)
> Component"Reuse?
>
> Personally I try to use packages as reused components as much as possible.
> Open
> Source projects tend to lack the extensive documentation generated by a
> commercial projects documentation team so I find I often need to 'look under
> the
> hood' to understand how things should get used.  For extensions polymorphism
> is
> definately the way to go and having the source makes it -so- much easier to
> know
> how to write a subclass.  Speaking of extensions, I have just written a
> JDBCAppender for my employer.  If people are interested I could easily
> replace
> the employer specific database stuff with standard JDBC and contribute it.
>
> Kevin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j as "Source-Code Level" or "Compiled (black-box) Component"Reuse?

Posted by Liu Xiao Hua <xi...@gridnode.com>.
Kevin:

I am also very interested in the JDBCAppender, Where can I get it?

Thanks a lot!

Liu Xiaohua

-----Original Message-----
From: Kevin Steppe [mailto:ksteppe@pacbell.net]
Sent: Wednesday, January 24, 2001 2:34 AM
To: LOG4J Users Mailing List
Subject: Re: Log4j as "Source-Code Level" or "Compiled (black-box)
Component"Reuse?


Personally I try to use packages as reused components as much as possible.
Open
Source projects tend to lack the extensive documentation generated by a
commercial projects documentation team so I find I often need to 'look under
the
hood' to understand how things should get used.  For extensions polymorphism
is
definately the way to go and having the source makes it -so- much easier to
know
how to write a subclass.  Speaking of extensions, I have just written a
JDBCAppender for my employer.  If people are interested I could easily
replace
the employer specific database stuff with standard JDBC and contribute it.

Kevin



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


Newbie question

Posted by Roger Kjensrud <ro...@cj.com>.
Hello,

I've just started to look at log4j, and have a couple of questions:

1. Is is possible to have different appenders that gets invoked for
different priorities only?
For example, I set the priority for the category to be INFO. Then, if for
INFO logging I would like to log to a specific appender only, and for ERROR
logging I would like to log to another appender only.

2. How would I enable the logging to a JMS topic? I assume I have to
implement the Appender interface?

Thank you for contributing with such a cool tool!!

Roger Kjensrud


RE: Log4j as "Source-Code Level" or "Compiled (black-box) Component"Reuse?

Posted by Roger Kjensrud <ro...@cj.com>.
Kevin,

I would be very interested in a JDBC appender....

Thanks,

Roger Kjensrud

> -----Original Message-----
> From: Kevin Steppe [mailto:ksteppe@pacbell.net]
> Sent: Tuesday, January 23, 2001 10:34 AM
> To: LOG4J Users Mailing List
> Subject: Re: Log4j as "Source-Code Level" or "Compiled (black-box)
> Component"Reuse?
>
>
> Personally I try to use packages as reused components as much as
> possible.  Open
> Source projects tend to lack the extensive documentation generated by a
> commercial projects documentation team so I find I often need to
> 'look under the
> hood' to understand how things should get used.  For extensions
> polymorphism is
> definately the way to go and having the source makes it -so- much
> easier to know
> how to write a subclass.  Speaking of extensions, I have just written a
> JDBCAppender for my employer.  If people are interested I could
> easily replace
> the employer specific database stuff with standard JDBC and contribute it.
>
> Kevin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>


Re: Log4j as "Source-Code Level" or "Compiled (black-box) Component"Reuse?

Posted by Kevin Steppe <ks...@pacbell.net>.
Personally I try to use packages as reused components as much as possible.  Open
Source projects tend to lack the extensive documentation generated by a
commercial projects documentation team so I find I often need to 'look under the
hood' to understand how things should get used.  For extensions polymorphism is
definately the way to go and having the source makes it -so- much easier to know
how to write a subclass.  Speaking of extensions, I have just written a
JDBCAppender for my employer.  If people are interested I could easily replace
the employer specific database stuff with standard JDBC and contribute it.

Kevin



RE: Log4j as "Source-Code Level" or "Compiled (black-box) Component" Reuse?

Posted by Ceki Gülcü <cg...@urbanet.ch>.
Mark,

At 17:18 23.01.2001 +0100, you wrote:
>John,
>
>This seems to me like a valid question (1).  Obviously, I myself tend more
>towards the black-box end of the spectrum.  While I think having the source
>code is great, and often needed, what I really want to do is just *use* the
>thing, out of the box.  My worry about modifying/extending the source code
>has two reasons: 1) I'm a lousy programmer, so the lousy hacks I wind up
>making to get the thing working the way I need it to are unlikely to be
>accepted for inclusion in the "real" source, and 2) that means that each new
>version is likely to break my app, and involve extra effort on my part to
>get it working again.  Perhaps, in the worst case, so much extra effort,
>that I would have been better off writing my own, lousy, but just-right for
>my needs, package, and not using the open source product at all, despite its
>higher quality overall.

When you use an external library you are basically saying I need its 
functionality and can live with the its shortcomings (if any).  It is hard 
to resist the temptation to re-invent the wheel. It really is! :-)  The 
temptation tends to be inversely proportional to the size of the wheel. Few 
people would be tempted to rewrite an XML parser or a web server. It would 
be very interesting but you are unlikely to re-write a better parser. It is 
very easy to write a simple logging library. Most developers can probably 
write one in a few days. However, I doubt if such an effort would be cost 
effective.

>All of which leads me to make the observation; if Open Source projects are
>to become the normal paradigm in the future, then they need to be useful to
>lousy programmers, and not just those programmers who are good enough to
>improve or expand on the package.  That may sound a strange, and I've said
>such things before, in other contexts, only to get flamed about "pandering
>to the lowest common denominator."  So let me add, in attempt to fend some
>of that off proactively, that I *am* the lowest common denominator, so I
>naturally have a lot of sympathy for that viewpoint!  :-)
>
>(1) But it would, wouldn't it?  :-)

What are you talking about? I don't believe for a second that you are a 
lousy programmer. If you are saying that open source projects should cater 
for newbies then I agree completely. Not  even seasoned developers should 
need to look under the hood.  I mean it's a logging package after all.

Having said that, it must be acknowledged that any tool takes time to 
learn. Log4j is no exception. I've been using CVS for about 5 years and I 
still need to refer to the manual from time to time. Does that mean that I 
should rewrite CVS? I have learned to live with the limits of that specific 
tool.

Coming back to the DOMConfigurator, I admit that the current 
re-configuration behavior is somewhat odd. However, this will be fixed in a 
future release. That's the advantage of using a regularly maintained 
library: wrinkles do get fixed. It just takes some time. Cheers, Ceki


----
Ceki Gülcü (cgu@urbanet.ch)


RE: Log4j as "Source-Code Level" or "Compiled (black-box) Component" Reuse?

Posted by Mark Masterson <ma...@compuserve.com>.
John,

This seems to me like a valid question (1).  Obviously, I myself tend more
towards the black-box end of the spectrum.  While I think having the source
code is great, and often needed, what I really want to do is just *use* the
thing, out of the box.  My worry about modifying/extending the source code
has two reasons: 1) I'm a lousy programmer, so the lousy hacks I wind up
making to get the thing working the way I need it to are unlikely to be
accepted for inclusion in the "real" source, and 2) that means that each new
version is likely to break my app, and involve extra effort on my part to
get it working again.  Perhaps, in the worst case, so much extra effort,
that I would have been better off writing my own, lousy, but just-right for
my needs, package, and not using the open source product at all, despite its
higher quality overall.

All of which leads me to make the observation; if Open Source projects are
to become the normal paradigm in the future, then they need to be useful to
lousy programmers, and not just those programmers who are good enough to
improve or expand on the package.  That may sound a strange, and I've said
such things before, in other contexts, only to get flamed about "pandering
to the lowest common denominator."  So let me add, in attempt to fend some
of that off proactively, that I *am* the lowest common denominator, so I
naturally have a lot of sympathy for that viewpoint!  :-)

(1) But it would, wouldn't it?  :-)

Cheers,
Mark