Generating Log Messages

Clearly, it becomes easier to manage your application setup if its log messages can be found in the same places as the log messages generated by WebLogic’s subsystems. This is especially true when your applications operate within a distributed environment. There are several ways to generate log messages and integrate them automatically with WebLogic’s logging architecture:

  • Use WebLogic’s tools to build custom log message catalogs and their associated Java APIs. Clients can conveniently invoke these various log methods exposed by these interfaces to generate log messages. These message catalogs can easily be internationalized.

  • Use WebLogic’s noncatalog logger to generate log messages. This logger doesn’t rely on a message catalog, and hence cannot be internationalized. However, it does allow you to publish log messages in a straightforward fashion. When localized log messages aren’t a requirement for your applications, the noncatalog logger makes it quick and easy to use WebLogic’s logging framework.

  • Use one of the log( ) methods available to an HTTP servlet.

We will also see how you can use WebLogic’s catalog and noncatalog logging from a remote Java client. In this case, the log messages are not transmitted to the server’s end but are simply logged to a local file and/or the console window.

Log Message Catalogs

WebLogic supports two types of message catalogs: simple text and log message catalogs. Simple text catalogs are collections of internationalized text ...

Get WebLogic: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.