avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <leifli...@tanukisoftware.com>
Subject Question about closing a LogKit PriorityFilteringTarget
Date Fri, 30 Jul 2004 05:19:41 GMT
I have been investigating a problem where LogTargets wrapped in a
PriorityFilteringTarget were not being closed correctly on application
shutdown.

As it turns out, the cause is in the Excalibur Logger
PriorityFilterTargetFactory.

The logkit PriorityFilteringTarget class has a second constructor which
accepts
a closeWrappedTarget argument. The PriorityFilterTargetFactory is calling
a version of the constructor which defaults to setting that argument to
false.

There are no javadocs explaining the purpose of this argument in the
class, and
I am not sure of the timing of its addition. I am trying to decide where
and how
to fix this problem. I can not think of any reason why you would not want to
close down the wrapped log targets in the first place. But given that
someone
went out of their way to provide this behavior, it seems like closing
them by
default would be better behavior.

If I change the default, then I can do so in the LogKit project and be
done with it.

If however, there is a good reason not to close the wrapped targets down
then
I will need to add a configuration property to the Excalibur logger
PriorityFilterTargetFactory class as It should use the same defaults.

The thing is that if the LogTarget is not wrapped, it will always be closed
down. The case where it is Wrapped by a PriorityFilteringTarget is actually
the only case where it would not be closed.

For now, I am going to modify LogKit so the default is to close the wrapped
LogTargets when the PriorityFilteringTarget is closed. If there are any
concerns about this change then I can go back and change it. I only make
an issue of this because someone appears to have gone out of their way to
make it work this way...

Digging around in CVS, the class was recently created to replace the
deprecated
PriorityFilter. The old system worked differently, so from what I can
tell, this
was not an issue.

Ahh. As I went to commit this, I found that my karma has been revoked
for the
avalon-logkit project. :-( I work on Logkit from time to time so unless
there
was a reason for it, I would still like to have access. :-)

Here is the patch. If someone could commit it I would appreciate it.
In addition to the one line change, there are a few tabs to spaces fixes.

Cheers,
Leif

Mime
View raw message