Hi,
We had that reflexion some weeks ago at work and we came to the conclusion
that reusable components like pools should not use ERROR but rather WARNING
log level. The motivation is that the definition of ERROR is specific to the
application and we dont want to have third-party components logging at that
level. In production, when we turn ERROR on to monitor what's going on on
the system, we want to be able to be selective on what is logged so the log
file remains readable and problems are easier to spot.
What do you guys think?
Vicnent
----- Original Message -----
From: "Leo Sutic" <[EMAIL PROTECTED]>
To: "Avalon Developer's List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 2:17 PM
Subject: AbstractPool logging
> All,
>
> currently the AbstractPool implementation in Excalibur logs failure to
> instantiate a component with a DEBUG level.
>
> I propose to change this to ERROR.
>
> The same change for:
>
> - when an exception is caught decomissioning an object.
> - "factory created class was null so a new instance could not be
created."
>
> Motivation being that all three cases involve an Exception being caught
and
> not re-thrown or wrapped. Thus, if the log level is not set to DEBUG, the
> client will just recieve a ComponentException ("could not find component")
> with no further explanation.
>
> +1 from me.
>
> /LS
>
> The patch is:
>
> @@ -95,9 +95,9 @@
> }
> catch (Exception e)
> {
> - if (getLogger().isDebugEnabled())
> + if (getLogger().isErrorEnabled())
> {
> - getLogger().debug("Error decommissioning object", e);
> + getLogger().error("Error decommissioning object", e);
> }
> }
> }
> @@ -127,17 +127,17 @@
> }
> catch( final Exception e )
> {
> - if( null != getLogger() && getLogger().isDebugEnabled() )
> + if( null != getLogger() && getLogger().isErrorEnabled() )
> {
> Class createdClass = m_factory.getCreatedClass();
> if (createdClass == null)
> {
> - getLogger().debug( "factory created class was
null
> so a new "
> + getLogger().error( "factory created class was
null
> so a new "
> + "instance could not be created.", e );
> }
> else
> {
> - getLogger().debug( createdClass.getName() +
> + getLogger().error( createdClass.getName() +
> ": could not be
instantiated.",
> e );
> }
> }
> @@ -158,9 +158,9 @@
> }
> catch( final Exception e )
> {
> - if( null != getLogger() &&
> getLogger().isDebugEnabled() )
> + if( null != getLogger() &&
> getLogger().isErrorEnabled() )
> {
> - getLogger().debug(
> m_factory.getCreatedClass().getName() +
> + getLogger().error(
> m_factory.getCreatedClass().getName() +
> ": improperly
decommissioned.",
> e );
> }
> }
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>