How to create Log Filters

Oracle Weblogic has a feature called Log Filters that allows an administrator to determine what is to be logged, by evaluating a simple expression.

For those in the development trenches, it is also possible to create a custom Java class to do the filtering by code (You can read more about this here: http://docs.oracle.com/cd/E24329_01/web.1211/e24428/config_logs.htm)

Here we will illustrate how to create a Log filter using the Web console:

1.       Inside your “Domain Structure”, click on your domain name. From there select the “Log Filter” Tab.

oracle weblogic book oracle weblogic books

2.       Next, choose to create a new Log filter. Creating a new Log filter requires defining a Log Filter Expression. In the following example we are filtering out all messages containing the Message Id “320012”:

oracle weblogic book oracle weblogic books

Once the filter is created, you just need to apply it to the servers from the console. To do this, simply click on each server in the console and go to Logging tab for the server. Open the Advanced section in order to apply the filter to the appropriate loggers.

oracle weblogic book oracle weblogic books

Learn more about Weblogic Log filter expressions at: http://docs.oracle.com/cd/E24329_01/web.1211/e24426/appendix_query.htm

Francesco Google+