How to filter OSB logging and redirect log records to any desirable destination?

The best practice to accomplish this task is to use Weblogic server startup class. In this class we should take Weblogic server "Logger" object and use it to attach additional appender. This appender can be implemented to redirect log messages to any destination You prefer. Log4j supports dozen of standard destinations, providing built in appenders like JDBCAppender, JMSAppender, FileAppender and many others. Lets say we need to redirect log messages from Oracle Service Bus to separate file. We are going to implement this approach on WebLogic version 10.3.5.0.

What is Weblogic server startup class?

This is general kind of java class which main method is called during server startup. Here is an example:

public class StartupClass {
    public static void main(String[] args) {
// Do some startup processing here
          }
}


Steps to configure Weblogic startup class for log redirecting to separate file

Any appender option could be configurable passing an argument to main method. In the case of example just file name is received through arguments.

Labels: , ,