Peter Donald a écrit :
> 
> On Tue, 25 Sep 2001 19:26, Sylvain Wallez wrote:
> > > > > class MyCustomHierarchy extends Hierarchy
> > > > > {
> > > > > ...do your tricky stuff here...
> > > > > }
> > > >
> > > > Won't help a lot : "tricky stuff" cannot access m_rootLogger which is
> > > > private ;)
> > >
> > > thats why I made a protected accessor getRootLogger() ;)
> >
> > Doh ! I was focused on the missing "public getRootLogger" and forgot it
> > already existed protected. Sorry !
> 
> ;)
> 
> > > > > or maybe something else? Would any of them work?
> > > >
> > > > Hierarchy.setDefaultLogTargets(LogTarget[] targets) would solve this
> > > > particular problem.
> > >
> > > thats easily doable.
> >
> > Since I need this one now, patch attached for Hierarchy and
> > LogKitManager !
> 
> applied.

Thanks.

> > I think a LogManager (or HierarchyManager ?) will be needed if we want
> > to build sophisticated log management apps, since such apps will need
> > detailed knowledge on Logger configurations which shouldn't be exposed
> > to normal client code (such as getLogTargets). I'll try to send a
> > proposal soon.
> 
> Sounds kool ;) Just FYI the way I originally wanted to do it was something
> like
> 
> Hierargy.getManager()
> 
> class LogManager
> {
>   setLogTargets( String name, LogTarget[] targets );
>   LogTarget[] getLogTargets( String name );
> 
>   setPriority( String name, Priority );
>   Priority getPriority( String name );
> 
>   ...insert other mutators/accessors here ...
> }
> 
> I am not sure how valid that is now or even if it is still a good idea ;)

I'm not sure wether the first parameter should be a String or a Logger
(which of course must belong to the managed hierarchy). In other words,
should the manager act on loggers/categories that already exist, or
should it create them on the fly when requested ?

And also, couldn't Hierarchy and HierarchyManager be merged ? If there's
no restriction for getting a manager once we know the hierarchy, it
would be better IMO to let the Hierarchy manage itself its category
tree, or we will end up with Hierarchy having only getLoggerFor() and
all other methods moved to HierarchyManager.

Thoughts ?

> > > > - LogKitManager.getHierarchy()
> > >
> > > You could just cache this before it gets passed to Hierarchy object. Or
> > > not? ie I would go
> > >
> > > Hierarchy h = new Hierarchy();
> > > LogKitManager lkm = new DefaultLogKitManager( h );
> > >
> > > //Manage h here
> > > manage( h );
> >
> > Won't be enough :
> > - LogKitManager can create its own Hierarchy
> > - I'd like to access the Hierarchy from a LogKitManageable (more
> > precisely a Cocoon component).
> 
> Convinced me. Anyone else mind this ?
> 
> > > > - Logger.isPriorityInherited()
> > >
> > > works for me.
> >
> > Cool, but we won't need it if we have a HierarchyManager...
> 
> ok - wont add it just yet then ;)
> 
> >
> > > > BTW, I wrote a LogTarget for Servidium's LogFactor5 (www.servidium.com)
> > > > which is a payware swing-based log monitoring GUI. They claim to be
> > > > logging toolkit independent (which they are), but only provide Log4J
> > > > integration. Do you think this could go into Avalon CVS ?
> > >
> > > This can go in fine I think. The problem will be getting it compiled for
> > > a release. If LogFactor5 has a demo version we can use that, otherwise we
> > > will have to write stubs or get you to submit the .class files prior to a
> > > release.
> >
> > I discovered today they've been acquired by another company. And since
> > LogFactor5 isn't their main product, I don't know if they will continue
> > supporting it. So maybe it's better to wait for now and see what will
> > happen.
> 
> okays.

Oh, forgot to say : if can be useful to anyone, I can post it.

And also, please find attached a StreamTargetFactory which allows to
configure StreamTargets with LogKitManager using OutputStreams stored in
the context (System.out/System.err are predefined entries).

> --
> Cheers,
> 
> Pete
> 
> ---------------------------------------------------------------
> The difference between genius, and stupidity? Genius has limits
> ---------------------------------------------------------------
> 

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

StreamTargetFactory.java

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to