You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@covalent.net on 2002/02/15 05:00:00 UTC

[logging] Default log

The current default is NoOp. I would like to change this to SimpleLog. If 
no other logger is found we don't want to lose messages - I think it
is a huge mistake to default to 'don't log anything if a logger can't be 
found'.

Also, for SimpleLog - I would like to change the default level to 
info ( or warn ). Error is far too high, it's better to get more 
info by default than to get none ( in a corectly configured 
situation you'll get what's configured, but if something is 
wrong you should get as much as possible ).



Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [logging] Default log

Posted by James Strachan <ja...@yahoo.co.uk>.
----- Original Message -----
From: <co...@covalent.net>
> The current default is NoOp. I would like to change this to SimpleLog. If
> no other logger is found we don't want to lose messages - I think it
> is a huge mistake to default to 'don't log anything if a logger can't be
> found'.

+1.

> Also, for SimpleLog - I would like to change the default level to
> info ( or warn ). Error is far too high, it's better to get more
> info by default than to get none ( in a corectly configured
> situation you'll get what's configured, but if something is
> wrong you should get as much as possible ).

+1 for warn, maybe going to System.err.

Maybe info is too low.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [logging] Default log

Posted by Oleg V Alexeev <oa...@apache.org>.
Hello costinm,

Friday, February 15, 2002, 7:00:00 AM, you wrote:

ccn> The current default is NoOp. I would like to change this to SimpleLog. If 
ccn> no other logger is found we don't want to lose messages - I think it
ccn> is a huge mistake to default to 'don't log anything if a logger can't be 
ccn> found'.

ccn> Also, for SimpleLog - I would like to change the default level to 
ccn> info ( or warn ). Error is far too high, it's better to get more 
ccn> info by default than to get none ( in a corectly configured 
ccn> situation you'll get what's configured, but if something is 
ccn> wrong you should get as much as possible ).

One addition - add stream property to the SimpleLog with default init
to the System.out or System.err.

-- 
Best regards,
 Oleg                            mailto:oalexeev@apache.org



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [logging] Default log

Posted by Paulo Gaspar <pa...@krankikom.de>.
I am so quiet because I completely agree with Costin and he
is doing the talking.

Just to say that there is another voice saying the same.


Have fun,
Paulo Gaspar

> -----Original Message-----
> From: costinm@covalent.net [mailto:costinm@covalent.net]
> Sent: Friday, February 15, 2002 11:20 PM
> To: Jakarta Commons Developers List; Morgan Delagrange
> Subject: Re: [logging] Default log
>
>
> On Fri, 15 Feb 2002, Morgan Delagrange wrote:
>
> > Probably not a good idea, because at certain log levels we
> would be sending
> > DEBUG information to standard error, which would really junk up
> logs that
> > specifically divert standard error to another file.  Your true error
> > messages would get buried in a mish-mash of debug statements.
>
> Same is true if we log to stdout, except that normal output will also
> get messed. I agree with Craig, stderr is better.
>
>
> > IMO "info" is too high.  Some applications generate a lot of
> "info" output.
> > However, I'm not too concerned about it; I doubt many users will use
> > SimpleLog for long.
>
> 'info' maps ( at least in my view ) to normal messages like "Application
> started succefully", etc. Things that you want to see.
>
> Warns, error, fatal reflect 'special' conditions, if everything works
> you'll not see any of those anyway.
>
> BTW, since commons-logging is supposed to act as a wrapper for
> multiple loggers, I hope in a future version ( 1.1 maybe ) it
> can also provide a 'default' setting for those loggers that
> is consistent ( and default to a reasonable level like info ).
>
> > An alternative to defaulting to SimpleLog would be to take the Log4J
> > approach; immediately print out a single error message if a logger
> > implementation has not been selected, then default to NoOp.
> This would be
> > my preference, I think.
>
> And subject the users to yet-another-configuration-nightmare ?
> I would stick with println(), it's faster and better and works
> without requiring me to set system properties ( which I may not
> be able to ) or learn a new system.
>
> Droping a jar file in lib/ is reasonably easy. I hope to fix
> the Log4jFactory to detect somehow if a config is present, and if
> not to provide some decent defaults - so using log4j instead
> of SimpleLog would just provide speed and more features, not
> config overhead.
>
> ( but I don't want to hold the release for that - I think
> the API is in a decent shape, and it can go on, we'll improve
> it in future versions if we need to )
>
> Costin
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [logging] Default log

Posted by co...@covalent.net.
On Fri, 15 Feb 2002, Morgan Delagrange wrote:

> Probably not a good idea, because at certain log levels we would be sending
> DEBUG information to standard error, which would really junk up logs that
> specifically divert standard error to another file.  Your true error
> messages would get buried in a mish-mash of debug statements.

Same is true if we log to stdout, except that normal output will also
get messed. I agree with Craig, stderr is better.


> IMO "info" is too high.  Some applications generate a lot of "info" output.
> However, I'm not too concerned about it; I doubt many users will use
> SimpleLog for long.

'info' maps ( at least in my view ) to normal messages like "Application 
started succefully", etc. Things that you want to see.

Warns, error, fatal reflect 'special' conditions, if everything works 
you'll not see any of those anyway. 

BTW, since commons-logging is supposed to act as a wrapper for 
multiple loggers, I hope in a future version ( 1.1 maybe ) it
can also provide a 'default' setting for those loggers that
is consistent ( and default to a reasonable level like info ). 

> An alternative to defaulting to SimpleLog would be to take the Log4J
> approach; immediately print out a single error message if a logger
> implementation has not been selected, then default to NoOp.  This would be
> my preference, I think.

And subject the users to yet-another-configuration-nightmare ? 
I would stick with println(), it's faster and better and works 
without requiring me to set system properties ( which I may not 
be able to ) or learn a new system.

Droping a jar file in lib/ is reasonably easy. I hope to fix 
the Log4jFactory to detect somehow if a config is present, and if
not to provide some decent defaults - so using log4j instead 
of SimpleLog would just provide speed and more features, not 
config overhead.

( but I don't want to hold the release for that - I think
the API is in a decent shape, and it can go on, we'll improve
it in future versions if we need to )

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [logging] Default log

Posted by Morgan Delagrange <md...@yahoo.com>.
----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Thursday, February 14, 2002 10:49 PM
Subject: Re: [logging] Default log


>
>
> On Thu, 14 Feb 2002 costinm@covalent.net wrote:
>
> > Date: Thu, 14 Feb 2002 20:00:00 -0800 (PST)
> > From: costinm@covalent.net
> > Reply-To: Jakarta Commons Developers List
<co...@jakarta.apache.org>
> > To: Jakarta Commons Developers List <co...@jakarta.apache.org>
> > Subject: [logging] Default log
> >
> > The current default is NoOp. I would like to change this to SimpleLog.
If
> > no other logger is found we don't want to lose messages - I think it
> > is a huge mistake to default to 'don't log anything if a logger can't be
> > found'.
> >
>
> My only problem with this is applications that use System.out for their
> own output (such as a "filter" in the traditional Unix sense of programs
> that read standard input and write to standard output).
>
> Maybe SimpleLog should go to standard error instead?

Probably not a good idea, because at certain log levels we would be sending
DEBUG information to standard error, which would really junk up logs that
specifically divert standard error to another file.  Your true error
messages would get buried in a mish-mash of debug statements.

> > Also, for SimpleLog - I would like to change the default level to
> > info ( or warn ). Error is far too high, it's better to get more
> > info by default than to get none ( in a corectly configured
> > situation you'll get what's configured, but if something is
> > wrong you should get as much as possible ).
> >
>
> My preference would be "warn" if we default to System.out, or "info" if we
> default to someplace else.

IMO "info" is too high.  Some applications generate a lot of "info" output.
However, I'm not too concerned about it; I doubt many users will use
SimpleLog for long.

> >
> > Costin
> >
>
> Craig
>

An alternative to defaulting to SimpleLog would be to take the Log4J
approach; immediately print out a single error message if a logger
implementation has not been selected, then default to NoOp.  This would be
my preference, I think.

- Morgan




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [logging] Default log

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 14 Feb 2002 costinm@covalent.net wrote:

> Date: Thu, 14 Feb 2002 20:00:00 -0800 (PST)
> From: costinm@covalent.net
> Reply-To: Jakarta Commons Developers List <co...@jakarta.apache.org>
> To: Jakarta Commons Developers List <co...@jakarta.apache.org>
> Subject: [logging] Default log
>
> The current default is NoOp. I would like to change this to SimpleLog. If
> no other logger is found we don't want to lose messages - I think it
> is a huge mistake to default to 'don't log anything if a logger can't be
> found'.
>

My only problem with this is applications that use System.out for their
own output (such as a "filter" in the traditional Unix sense of programs
that read standard input and write to standard output).

Maybe SimpleLog should go to standard error instead?

> Also, for SimpleLog - I would like to change the default level to
> info ( or warn ). Error is far too high, it's better to get more
> info by default than to get none ( in a corectly configured
> situation you'll get what's configured, but if something is
> wrong you should get as much as possible ).
>

My preference would be "warn" if we default to System.out, or "info" if we
default to someplace else.

>
> Costin
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>