This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
* 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.
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.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com