File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Customized logging with Apache Muse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Customized logging with Apache Muse" Watch "Customized logging with Apache Muse" New topic
Author

Customized logging with Apache Muse

David Brossard
Ranch Hand

Joined: Jun 03, 2004
Posts: 107
Hi,

I'd like to customize the way a Muse web service is logging information. I found the following so far:

- Muse uses the JDK logging API

Logging is done with the JDK logging API. The two elements under <logging/> - <log-file/> and <log-level/> - allow you to specify where the Muse log file will be written and at what level of detail it should record, respectively.

The log file path should be relative to the application's working directory; in the case of the J2EE, this is the root of the WAR. The sample project will create a log file at /WEB-INF/services/muse/log/muse.log. The file will be overwritten each time the application is restarted.
from http://ws.apache.org/muse/docs/2.2.0/manual/architecture/deployment-descriptor.html

- Java Logging can be extended with new handlers

J2SE provides the following Handlers:

* StreamHandler: A simple handler for writing formatted records to an OutputStream.
* ConsoleHandler: A simple handler for writing formatted records to System.err
* FileHandler: A handler that writes formatted log records either to a single file, or to a set of rotating log files.
* SocketHandler: A handler that writes formatted log records to remote TCP ports.
* MemoryHandler: A handler that buffers log records in memory.

It is fairly straightforward to develop new Handlers. Developers requiring specific functionality can either develop a Handler from scratch or subclass one of the provided Handlers.
from http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html#1.5

Obviously one needs to write a configuration file:
The logging configuration can be initialized using a logging configuration file that will be read at startup. This logging configuration file is in standard java.util.Properties format.
from http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html#1.8

But my gut feeling is that the muse framework programmatically configures the logging framework based on the values read from the muse.xml. In that case, there is no way one can use a custom handler, is there? Let alone use a pre-existing one.

Does anyone have an idea? What would be the behavior if I did put in a logging config file? I suppose that the assumed programatic configuration would overwrite the one from the file effectively cancelling out the config file's effect.


No matter what they say in Ohio, we're still first in flight!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Customized logging with Apache Muse
 
Similar Threads
Logging
How to use java.util.logging.Handler class?
Eclipse + APACHE Tomcat 6.0
Java 1.4 Enhancements
java logging in JApplet