You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/06/08 14:15:28 UTC

Logging (was Re: Feature)

>>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:

 BP> Maybe 4 levels of log NONE=well, none :), ALL or DEBUG= log
 BP> everything, MARKER=the beginning and ending of a task, MESSAGE=
 BP> the same as what is seen on the console.

Actually there are already different levels of logging (ERR, INFO,
WARN, VERBOSE) in Project and each task can emit information at any of
those levels. Only thing that is missing is the granularity of output
you'd like to have.

One could move the logging into Task instead of Project and have a
loglevel attribute in the Task class. This could be set to the Project's
value by default.

Doing so would enable something like

<target name="compile">
  <mkdir ... />
  <javac ... loglevel="VERBOSE" />
  <copyfile ... loglevel="WARN" />
</target>

This would make mkdir use Project's loglevel. javac would be verbose
and copyfile would suppress all informational messages without caring
for Project's loglevel.

Comments?

Stefan

Re: Logging (was Re: Feature)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:

 BP> Can the projects log level be set from inside the build file (or
 BP> only form the command line) ?

Currently it can only be set by command-line parameters. Default is
INFO, -verbose changes it to VERBOSE and -quiet to WARN. We probably
could invent a magic property for it.

 BP> It should be fairly easy to add the loglevel stuff to the
 BP> task... 

Yes, I was thinking along the lines you've described myself.

Stefan

Re: Logging (was Re: Feature)

Posted by Brill Pappin <jo...@jmonkey.com>.
Can the projects log level be set from inside the build file (or only form
the command line) ?

It should be fairly easy to add the loglevel stuff to the task... just add
it and a log(String,int)::void method (as final) to the abstract task
class... this would go in without breaking everything else.
The tasks could then call the log method with a int to specify the entry
level...and let the abstract class filter what actually needs to be logged.

- Brill Pappin

----- Original Message -----
From: "Stefan Bodewig" <bo...@bost.de>
To: <an...@jakarta.apache.org>
Sent: Thursday, June 08, 2000 8:15 AM
Subject: Logging (was Re: Feature)


> >>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:
>
>  BP> Maybe 4 levels of log NONE=well, none :), ALL or DEBUG= log
>  BP> everything, MARKER=the beginning and ending of a task, MESSAGE=
>  BP> the same as what is seen on the console.
>
> Actually there are already different levels of logging (ERR, INFO,
> WARN, VERBOSE) in Project and each task can emit information at any of
> those levels. Only thing that is missing is the granularity of output
> you'd like to have.
>
> One could move the logging into Task instead of Project and have a
> loglevel attribute in the Task class. This could be set to the Project's
> value by default.
>
> Doing so would enable something like
>
> <target name="compile">
>   <mkdir ... />
>   <javac ... loglevel="VERBOSE" />
>   <copyfile ... loglevel="WARN" />
> </target>
>
> This would make mkdir use Project's loglevel. javac would be verbose
> and copyfile would suppress all informational messages without caring
> for Project's loglevel.
>
> Comments?
>
> Stefan


Re: Logging (was Re: Feature)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CE" == Christopher Elkins <ce...@scardini.com> writes:

 CE> FWIW, log4j's license is on opensource.org's approved list

As oposed to the Apache Software License? 8^)

 CE> and it's a whole lot better than the wretched AlphaWorks license.

It surely is. IANAL but I think its license and the Apache license
play together a lot better than say ASL and GPL and this license would
surely allow us to ship log4j with Ant.

I guess it's a question of priority. I'm happy with Ants current
logging capabilities and would like to see improvements in other parts
of it.

Stefan

Re: Logging (was Re: Feature)

Posted by Christopher Elkins <ce...@scardini.com>.
FWIW, log4j's license is on opensource.org's approved list
<http://www.opensource.org/licenses/>, and it's a whole lot better than the
wretched AlphaWorks license.

--
Christopher Elkins


> Yes, I've seen it, but I tend to stay away from IBMs APIs if I can help
> it... I just don't trust IBM with this stuff, after seeing some of the cool
> but crappy (and often proprietary) stuff they have produced... not to
> mention it all falls under their own lic. witch makes me nervous.
>
> - Brill Pappin
>
> ----- Original Message -----
> From: "Fergus Gallagher" <Fe...@OrbisUK.com>
> To: <an...@jakarta.apache.org>
> Sent: Thursday, June 08, 2000 8:50 AM
> Subject: Re: Logging (was Re: Feature)
>
>
> > Just to throw something else into the ring, http://www.log4j.org has an
> > excellent logging utility with multi-level granularity.  It is the
> > open-source version of the IBM logger previously at alphaworks
> >
> > The XML configuration is just dandy.
> >
> > Fergus
> >



RE: Logging (was Re: Feature)

Posted by Brill Pappin <jo...@jmonkey.com>.
Sounds like a good API and I wouldn't mind taking a look... why don't you
put it up on sourceforge.net?

- Brill Pappin

[...]
> At 09:48  8/6/00 -0400, Brill Pappin wrote:
> >Yes, I've seen it, but I tend to stay away from IBMs APIs if I can help
[...]
> I recently required a log library and wasn't aware of log4j.
> Ironically the
> design is very very similar. Actually it is a cross between that and the
> Logging Api recently released at www.alphaworks.ibm.com. It's about 90%
[...]


Re: Logging (was Re: Feature)

Posted by Peter Donald <do...@mad.scientist.com>.
Hi,

At 09:48  8/6/00 -0400, Brill Pappin wrote:
>Yes, I've seen it, but I tend to stay away from IBMs APIs if I can help
>it... I just don't trust IBM with this stuff, after seeing some of the cool
>but crappy (and often proprietary) stuff they have produced... not to
>mention it all falls under their own lic. witch makes me nervous.

I recently required a log library and wasn't aware of log4j. Ironically the
design is very very similar. Actually it is a cross between that and the
Logging Api recently released at www.alphaworks.ibm.com. It's about 90%
complete (for my needs at the moment) at the moment and I could clean it up
and send it to you if you want. Any licensing deal is fine as I own the
code ... just as long as it disclaims me from all liability :P. 

The only thing with my system is that it allows a lot of flexability. You
can have log categories that output to multiple targets and can even be
filtered by "FilterTargets". It is useful in application servers where you
have to do multiple things when logging (ie log to file and also send mail
to an admin on category FATAL log messages). It also allows different
categories to be logged to different places (ie MY_SERVLET category to
myServlet.log and YOUR_SERVLET category to yourServlet.log). Not yet sure
if this is a good thing. I may end up removing the features to increase
usability .. don't know.

Email me if you want it :P.


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: Logging (was Re: Feature)

Posted by Brill Pappin <jo...@jmonkey.com>.
Yes, I've seen it, but I tend to stay away from IBMs APIs if I can help
it... I just don't trust IBM with this stuff, after seeing some of the cool
but crappy (and often proprietary) stuff they have produced... not to
mention it all falls under their own lic. witch makes me nervous.

- Brill Pappin

----- Original Message -----
From: "Fergus Gallagher" <Fe...@OrbisUK.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, June 08, 2000 8:50 AM
Subject: Re: Logging (was Re: Feature)


> Just to throw something else into the ring, http://www.log4j.org has an
> excellent logging utility with multi-level granularity.  It is the
> open-source version of the IBM logger previously at alphaworks
>
> The XML configuration is just dandy.
>
> Fergus
>
> At 14:15 08/06/00 +0200, Stefan Bodewig wrote:
> > >>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:
> >
> >  BP> Maybe 4 levels of log NONE=well, none :), ALL or DEBUG= log
> >  BP> everything, MARKER=the beginning and ending of a task, MESSAGE=
> >  BP> the same as what is seen on the console.
> >
> >Actually there are already different levels of logging (ERR, INFO,
> >WARN, VERBOSE) in Project and each task can emit information at any of
> >those levels. Only thing that is missing is the granularity of output
> >you'd like to have.
> >
> >One could move the logging into Task instead of Project and have a
> >loglevel attribute in the Task class. This could be set to the Project's
> >value by default.
> >
> >Doing so would enable something like
> >
> ><target name="compile">
> >   <mkdir ... />
> >   <javac ... loglevel="VERBOSE" />
> >   <copyfile ... loglevel="WARN" />
> ></target>
> >
> >This would make mkdir use Project's loglevel. javac would be verbose
> >and copyfile would suppress all informational messages without caring
> >for Project's loglevel.
> >
> >Comments?
> >
> >Stefan
>
> --
> Fergus Gallagher
> Orbis
> http://www.orbisuk.com/
> +44-(0)20-8987 0717
>


Re: Logging (was Re: Feature)

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
Just to throw something else into the ring, http://www.log4j.org has an 
excellent logging utility with multi-level granularity.  It is the 
open-source version of the IBM logger previously at alphaworks

The XML configuration is just dandy.

Fergus

At 14:15 08/06/00 +0200, Stefan Bodewig wrote:
> >>>>> "BP" == Brill Pappin <jo...@jmonkey.com> writes:
>
>  BP> Maybe 4 levels of log NONE=well, none :), ALL or DEBUG= log
>  BP> everything, MARKER=the beginning and ending of a task, MESSAGE=
>  BP> the same as what is seen on the console.
>
>Actually there are already different levels of logging (ERR, INFO,
>WARN, VERBOSE) in Project and each task can emit information at any of
>those levels. Only thing that is missing is the granularity of output
>you'd like to have.
>
>One could move the logging into Task instead of Project and have a
>loglevel attribute in the Task class. This could be set to the Project's
>value by default.
>
>Doing so would enable something like
>
><target name="compile">
>   <mkdir ... />
>   <javac ... loglevel="VERBOSE" />
>   <copyfile ... loglevel="WARN" />
></target>
>
>This would make mkdir use Project's loglevel. javac would be verbose
>and copyfile would suppress all informational messages without caring
>for Project's loglevel.
>
>Comments?
>
>Stefan

--
Fergus Gallagher
Orbis
http://www.orbisuk.com/
+44-(0)20-8987 0717