Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 4ca7151

Browse files
committed
readme updates and other doc
1 parent a11bd75 commit 4ca7151

File tree

4 files changed

+62
-129
lines changed

4 files changed

+62
-129
lines changed

README.md

+53-125
Original file line numberDiff line numberDiff line change
@@ -85,123 +85,13 @@ normally located at `~/.m2/repository/com/oracle/weblogic`.
8585
Note: If you populated your local repository using the Oracle Maven Synchronization plugin, then this
8686
step is *not* required.
8787

88-
To access the Oracle Maven repository, there are two requirements to be aware of:
88+
To access the Oracle Maven repository, refer to the documentation
89+
[available here](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9010).
8990

90-
1. You must be using [Maven 3.2.5](http://maven.apache.org/docs/3.2.5/release-notes.html) or later.
91-
This contains the version of the [Wagon 2.8](http://maven.apache.org/wagon/) component that has
92-
been enhanced to support access to artifacts that are protected by
93-
[HTTP authentication schemes](https://issues.apache.org/jira/projects/WAGON/issues/WAGON-422).
94-
95-
2. You must be registered with OTN and have accepted the license agreement to access and use the
96-
Oracle Maven Repository. This can be done with either a new or an existing OTN user account by
97-
accessing the http://maven.oracle.com site and selecting the registration link.
98-
After registering, then you just need to configure your local Maven environment with the details
99-
of the Oracle Maven Repository, including the information that relates to the authentication model
100-
specifying your OTN user name and password.
101-
102-
#### Configure Maven
103-
104-
#### 1. Encrypt your OTN Password.
105-
106-
You need to configure Maven to use the Oracle Maven Repository. This involves telling Maven about the repository and providing the necessary information to authenticate to the repository.
107-
The following steps show you how to save your OTN password in your `settings.xml` file so that you do not have to specify it manually every time.
108-
Oracle recommends that you encrypt your password, using the utilities provided with Maven.
109-
110-
Here are the steps to encrypt your password and save it in your settings. For more information, refer to [Maven Password Encryption](http://maven.apache.org/guides/mini/guide-encryption.html).
111-
112-
```
113-
mvn --encrypt-master-password my_master_password
114-
```
115-
The output will be a string similar to this:
116-
117-
`{abcdefghijklmnopqrstuvwxyz123=}`
118-
119-
Save this value in your Maven `settings-security.xml` file.
120-
121-
A copy of your `~/.m2/settings-security.xml` file will look like this:
122-
```
123-
<settingsSecurity>
124-
<master>{abcdefghijklmnopqrstuvwxyz123=}</master>
125-
</settingsSecurity>
126-
```
127-
128-
Now that you have a master password defined, you can encrypt your OTN password using the following command:
129-
```
130-
mvn --encrypt-password my_OTN_password
131-
```
132-
The output will be another string that looks like this:
133-
134-
`{==thisIs12My34_OTN_45_encrypted==}`
135-
136-
This will be the password that you provide in the `server` section of your `settings.xml` file when you configure the HTTP Wagon.
137-
138-
#### 2. Add the Oracle Maven Repository to your `settings.xml` file.
139-
140-
Add a repository definition to your Maven `settings.xml` file. The repository definition should look like the following:
141-
142-
```
143-
<profiles>
144-
<profile>
145-
<id>main</id>
146-
<activation>
147-
<activeByDefault>true</activeByDefault>
148-
</activation>
149-
<repositories>
150-
<repository>
151-
<id>maven.oracle.com</id>
152-
<url>https://maven.oracle.com</url>
153-
<layout>default</layout>
154-
<releases>
155-
<enabled>true</enabled>
156-
</releases>
157-
</repository>
158-
</repositories>
159-
160-
<pluginRepositories>
161-
<pluginRepository>
162-
<id>maven.oracle.com</id>
163-
<url>https://maven.oracle.com</url>
164-
</pluginRepository>
165-
</pluginRepositories>
166-
</profile>
167-
</profiles>
168-
```
169-
170-
The Maven `settings.xml` file requires additional settings to support the Oracle Maven Repository.
171-
To configure the HTTP Wagon, add the following `<server>` element to the `<servers>` section of the Maven `settings.xml` file.
172-
```
173-
<servers>
174-
<server>
175-
<username>my_OTN_user_name</username>
176-
<password>{==thisIs12My34_OTN_45_encrypted==}</password>
177-
<configuration>
178-
<basicAuthScope>
179-
<host>ANY</host>
180-
<port>ANY</port>
181-
<realm>OAM 11g</realm>
182-
</basicAuthScope>
183-
<httpConfiguration>
184-
<all>
185-
<params>
186-
<property>
187-
<name>http.protocol.allow-circular-redirects</name>
188-
<value>%b,true</value>
189-
</property>
190-
</params>
191-
</all>
192-
</httpConfiguration>
193-
</configuration>
194-
<id>maven.oracle.com</id>
195-
</server>
196-
</servers>
197-
```
198-
199-
If needed, specify the `proxies` that are required.
20091

20192
### Building the WebLogic Logging Exporter
20293

203-
To build the WebLogic Logging Exporter, simply clone the project from GitHub and then build it
204-
with Maven:
94+
To build the WebLogic Logging Exporter, clone the project from GitHub and then build it with Maven:
20595

20696
```
20797
git clone [email protected]:oracle/wls-logging-exporter.git
@@ -235,21 +125,59 @@ This section outlines the steps that are required to add the Weblogic Logging Ex
235125
</startup-class>
236126
```
237127
238-
1. Add `weblogic-logging-exporter.jar` and `snakeyaml.jar` to your classpath
128+
1. Add `weblogic-logging-exporter.jar` and `snakeyaml-1.23.jar` to your classpath.
129+
130+
This project requires `snakeyaml` to parse the YAML configuration file. If you built the project locally,
131+
you can find this JAR file in your local maven repository at `~/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar`.
132+
Otherwise, you can download it from [Maven Central](https://search.maven.org/artifact/org.yaml/snakeyaml/1.23/bundle).
133+
134+
Place this file in a suitable location, e.g. your domain directory.
135+
136+
Update the server classpath to include these two files. This can be done by adding a statement to the end of your
137+
`setDomainEnv.sh` script in your domain's `bin` directory as follows (this example assumes your domain
138+
directory is `/u01/base_domain`):
139+
140+
```
141+
export CLASSPATH="/u01/base_domain/weblogic-logging-exporter-0.1.jar:/u01/base_domain/snakeyaml-1.23.jar:$CLASSPATH"
142+
```
143+
144+
1. Create a configuration file for the WebLogic Logging Exporter.
145+
146+
Create a file named `WebLogicLoggingExporter.yaml` in your domain's `config` directory. You can copy the
147+
[sample provided in this project](samples/WebLogicLoggingExporter.yaml) as a starting point. That sample
148+
contains details of all of the available configuration options. A completed configuration file might look
149+
like this:
150+
151+
```
152+
publishHost: localhost
153+
publishPort: 9200
154+
domainUID: domain1
155+
weblogicLoggingExporterEnabled: true
156+
weblogicLoggingIndexName: wls
157+
weblogicLoggingExporterSeverity: Notice
158+
weblogicLoggingExporterBulkSize: 1
159+
weblogicLoggingExporterFilters:
160+
- filterExpression: 'severity > Warning'
161+
```
162+
163+
Note that you must give a unique `domainUID` to each domain. This value is used to filter logs by domain when you
164+
send the logs from multiple domains to the same Elasticsearch server. If you are using the WebLogic Kubernetes
165+
Operator, it is strongly recommended that you use the same `domainUID` value that you use for the domain.
166+
167+
If you prefer to place the configuration file in a different location, you can set the environment variable
168+
`WEBLOGIC_LOGGING_EXPORTE_CONFIG_FILE` to point to the location of the file.
169+
170+
1. Restart the servers to activate the changes. After restarting the servers, they will load the WebLogic
171+
Logging Exporter and start sending their logs to the specified Elasticsearch instance. You can then
172+
access them in Kibana as shown in the example below, you will need to create an index first and then go to
173+
the visualization page.
239174
240-
This project requires the YAML parser to parse the configuration file. Thus you also need to add the
241-
snakeyaml.jar to your class path. If you have build the project yourself, the jar should be available as
242-
repository/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar, or you can download that from
243-
https://jar-download.com/artifacts/org.yaml/snakeyaml/1.19/source-code
175+
![Kibana screenshot](images/screenshot.png)
244176
245-
You may want to create a file named "WebLogicLoggingExporter.yaml" and put it under the config directory
246-
of domain home. This is the default location. Or you can specify a system variable named
247-
"WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE" and have it pointed to the configuration file.
248-
Refer to the later section for the content of this file.
249177
250-
Restart the domain, the domain logs will be posted to ElasticSearch. You can do the following curl
251-
command to verify that domain logs has been posted to Elasticsearch. The default index name is "wls",
252-
and docs.count should be greater than 0 indicating that log entries is being sent to ElasticSearch.
178+
You can also use a curl command similar to the following example to verify that logs have been posted to Elasticsearch.
179+
The default index name is "wls", and docs.count should be greater than zero indicating that log entries
180+
are being sent to Elasticsearch.
253181
254182
```
255183
$ curl "localhost:9200/_cat/indices?v"

images/screenshot.png

223 KB
Loading

pom.xml

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<groupId>oracle.kubernetes</groupId>
88
<artifactId>weblogic-logging-exporter</artifactId>
99
<packaging>jar</packaging>
10-
<version>0.1-SNAPSHOT</version>
10+
<version>0.1</version>
1111

1212
<name>WebLogic Logging Exporter</name>
13-
<description>An exporter that integrates WLS logs into ElasticSearch and Kibana</description>
13+
<description>An exporter that integrates WebLogic Server logs into ElasticSearch and Kibana</description>
1414

15-
<url>https://orahub.oraclecorp.com/oracle/wls-logging-exporter</url>
15+
<url>https://github.com/oracle/weblogic-logging-exporter</url>
1616
<inceptionYear>2018</inceptionYear>
1717
<licenses>
1818
<license>
@@ -22,6 +22,10 @@
2222
</licenses>
2323

2424
<!--
25+
26+
Uncomment this section if you wish to obtain dependencies from the Oracle Maven repository.
27+
See the README for details.
28+
2529
<repositories>
2630
<repository>
2731
<releases>
@@ -40,6 +44,7 @@
4044
<url>https://maven.oracle.com</url>
4145
</pluginRepository>
4246
</pluginRepositories>
47+
4348
-->
4449

4550
<build>

samples/weblogicLoggingExporter.yaml renamed to samples/WebLogicLoggingExporter.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This is a sample configuration file for weblogic Logging Exporter
88
# The exporter will look for the file specified by the system variable "WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE",
99
# if this is not specified, will search by the default name under domain config directory.
10-
# By default, the logging exporter will look for this file "weblogicLoggingExporter.yaml" under the
10+
# By default, the logging exporter will look for this file "WebLogicLoggingExporter.yaml" under the
1111
# domain config directory.
1212
# If file doesn't exist, will use all the defaults.
1313

0 commit comments

Comments
 (0)