Expose custom application logging on WebLogic in Log Analytics image 42

Expose custom application logging on WebLogic in Log Analytics

Custom applications – standard Java EE, ADF or other Fusion Middleware such as SOA Suite – on WebLogic can produce logging through the WebLogic Diagnostics Framework (WLDF). Simply put: write log messages using Logger classes similar to standard Java Log and Log4J – read this article by my colleague Aino Andriessen for some details: https://technology.amis.nl/2011/01/12/oracle-diagnostics-logging-odl-for-application-development/ and this three part series by Duncan Mills: https://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part .

The default configuration of WebLogic Servers is such that logging produced by applications through the Loggers as described above is written to the diagnostics log file for the managed server. And this file is not by default included in the log file associations for the WebLogic Domain entity in Log Analytics.

In order to harvest custom application logging into Log Analytics, an association needs to be created for the diagnostics file. Let me show you how to do that.

Click on Configuration in Log Analytics page. The overview is shown of all Log Sources and Entities.

image

Click on WebLogic Servers. Click on node for the WebLogic Server for which you want to start harvesting diagnostic logging.

The current associations for the node are listed.

image

Click onĀ  Add to create a new Association. The popup shows a list of know log files for which an association can be added:

image

Select the diagnostics log. Press Select.

A message is displayed:

image

Click on Save.

After a little while, the agent on the WebLogic Host has been updated and one additional associated log source is indicated:

image

 

Provided the Log Levels have been configured appropriately for the custom application loggers (see this blog article about setting these levels) – we will now be able to see custom application logging in Log Analytics.

Given this application code:

image

We will have log messages from this application in the Standard Out log source (not a good practice) and in the Diagnostics file (fine practice):

image