cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Ed Ward)
Subject Re: Cocoon Log
Date Tue, 18 Jan 2000 17:48:48 GMT
On Mon, 17 Jan 2000 22:15:50 +0100, you wrote:

>Good server software has log. 
>Why? because good server hardware has no screen :)
>Seriously, I admit a good logging subsystem is missing in Cocoon and I
>agree that logging is a critical thing when the complexity of the
>software increases.
>Here is what I propose:
>1) create two interfaces LogConsumer and LogProducer.
>public interface LogConsumer {
>	void log(String message);
>	// plus all other required log methods
>public interface LogProducer {
>	void setLogConsumer(LogConsumer log);
>2) if your component wants to log something, it implements logproducer
>and the factory will give you the logger where to log stuff.
>3) depending on the use (servlet mode, command line mode, API mode)
>Cocoon will forward these log messages to the appropriate stream.
>NOTE: complex mail handling such as syslogd use, mail forwarding and
>such DO NOT belong to the Cocoon project, but, rather, to the servlet
>engine. This extended log engine was scheduled for but it's
>now evaluated for Tomcat. (see Ricardo's forwarded message about IBM
>Also, Cocoon internals will be logged on the created channels.... I'll
>add these log capabilities in Cocoon 1.7 as soon as I get back home...

How about an additional LogFilter interface that the consumer can
optionally implement? The interface could have a method 'canLog()' that the
producer would call prior to logging the event to determine whether the
details should be logged.

Also, how about a class that encapsulates the log details: date, time,
message etc.?

I'm currently looking at Sun's Java Management Extensions (JMX) that have
something similar but more generic. They detail a NotificationClass,
NotificationListener, NotificationFilter and NotificationBroadcaster. The
notification model is part of the instrumention provided for Managed Beans


View raw message