WebLogic Logging Exporter
The goal of this project is to provide an easy to configure, robust, and production-ready solution to access WLS log information through Elasticsearch and Kibana.
The WebLogic Logging Exporter adds a log event handler to WebLogic Server, such that WebLogic Server logs can be integrated into Elastic Stack in Kubernetes directly, by using the Elasticsearch REST API.
The current version of the WebLogic Logging Exporter is 0.1, which was released on March 16, 2019. This version supports pushing logs into Elasticsearch using the REST API.
The following features are planned for the next few releases:
- Push logs into a fleuntd aggregator using the REST API.
- Write logs in JSON format into the file system so that they could be collected and published by a sidecar, e.g. fluentd or Logstash.
- Provide the ability to publish other logs (i.e. other than the server logs).
- How to download the release
- How to build from source
- How to install the WebLogic Logging exporter
- How to run Elasticsearch and Kibana locally for testing
- How to contribute to this project
- License information
Download the release
You can download the WebLogic Logging Exporter already compiled for you from the releases page.
Building from source
If you prefer, you can build the WebLogic Logging Exporter from the source code. To do this, you will need access to some WebLogic Server libraries. There are two ways to get these libraries:
- Populate your local Maven repository with the required files from a local WebLogic Server installation using the Oracle Maven Synchronization plugin, or
- Use the Oracle Maven repository to download them as part of your build; this requires registration and configuring your local Maven installation with the appropriate authentication details.
Populating your local Maven repository from a local WebLogic Server installation
You can use the Oracle Maven Synchronization plugin, which is included in your WebLogic Server installation, to install the necessary dependencies into your local Maven repository.
There are two steps:
- Install the Oracle Maven Synchronization plugin.
- Run the
pushgoal to populate your local Maven repository from your WebLogic Server installation.
Installing the Oracle Maven Synchronization plugin
To install the plugin, navigate to your WebLogic Server installation, then enter the commands (this example
assumes you installed WebLogic Server in
cd /u01/wlshome/oracle_common/plugins/maven/com/oracle/12.2.1/oracle-maven-sync mvn install:install-file -DpomFile=oracle-maven-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar
Popoulating your local Maven repository
To populate your local Maven repository from your WebLogic Server installation, enter this command:
mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=/u01/wlshome
You can verify the dependencies were installed by looking in your local Maven repository which is
normally located at
Using the Oracle Maven repository
Note: If you populated your local repository using the Oracle Maven Synchronization plugin, then this step is not required.
To access the Oracle Maven repository, refer to the documentation available here.
Building the WebLogic Logging Exporter
To build the WebLogic Logging Exporter, clone the project from GitHub and then build it with Maven:
git clone email@example.com:oracle/wls-logging-exporter.git mvn install
weblogic-logging-exporter-0.1.jar will be available under the
This section outlines the steps that are required to add the Weblogic Logging Exporter to Weblogic Server.
Download or build the WebLogic Logging Exporter as described above.
weblogic-logging-exporter-0.1.jarinto a suitable location, e.g. into your domain directory.
Add a startup class to your domain configuration.
- In the Administration Console, navigate to "Environment" then "Startup and Shutdown classes" in the main menu.
- Add a new Startup class. You may choose any descriptive name and the class name must be
- Target the startup class to each server that you want to export logs from.
You can verify this by checking for the update in your
config.xmlwhich should be similar to this example:
<startup-class> <name>LoggingExporterStartupClass</name> <target>AdminServer</target> <class-name>weblogic.logging.exporter.Startup</class-name> </startup-class>
snakeyaml-1.23.jarto your classpath.
This project requires
snakeyamlto parse the YAML configuration file. If you built the project locally, you can find this JAR file in your local maven repository at
~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar. Otherwise, you can download it from Maven Central.
Place this file in a suitable location, e.g. your domain directory.
Update the server classpath to include these two files. This can be done by adding a statement to the end of your
setDomainEnv.shscript in your domain's
bindirectory as follows (this example assumes your domain directory is
Create a configuration file for the WebLogic Logging Exporter.
Create a file named
WebLogicLoggingExporter.yamlin your domain's
configdirectory. You can copy the sample provided in this project as a starting point. That sample contains details of all of the available configuration options. A completed configuration file might look like this:
publishHost: localhost publishPort: 9200 domainUID: domain1 weblogicLoggingExporterEnabled: true weblogicLoggingIndexName: wls weblogicLoggingExporterSeverity: Notice weblogicLoggingExporterBulkSize: 1 weblogicLoggingExporterFilters: - filterExpression: 'severity > Warning'
Note that you must give a unique
domainUIDto each domain. This value is used to filter logs by domain when you send the logs from multiple domains to the same Elasticsearch server. If you are using the WebLogic Kubernetes Operator, it is strongly recommended that you use the same
domainUIDvalue that you use for the domain.
If you prefer to place the configuration file in a different location, you can set the environment variable
WEBLOGIC_LOGGING_EXPORTE_CONFIG_FILEto point to the location of the file.
Restart the servers to activate the changes. After restarting the servers, they will load the WebLogic Logging Exporter and start sending their logs to the specified Elasticsearch instance. You can then access them in Kibana as shown in the example below. You will need to create an index first and then go to the visualization page.
You can also use a curl command similar to the following example to verify that logs have been posted to Elasticsearch.
The default index name is
docs.count should be greater than zero indicating that log entries
are being sent to Elasticsearch.
$ curl "localhost:9200/_cat/indices?v" health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open wls q4Q2v2dXTBOyYsHZMdDe3H 5 1 23 0 101kb 101kb
Running Elasticsearch and Kibana locally for testing
If you wish to test on your local machine, a sample is provided to run Elasticsearch and Kibana in Docker on your local machine.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the Universal Permissive License, Version 1.0