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

Commit b61943f

Browse files
committed
merge pr from nick, with small modifications
Signed-off-by: Mark Nelson <[email protected]>
1 parent 742ea49 commit b61943f

File tree

3 files changed

+41
-25
lines changed

3 files changed

+41
-25
lines changed

Diff for: README.md

+36-25
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ This section outlines the steps that are required to add the WebLogic Logging Ex
119119
</startup-class>
120120
```
121121
122-
1. Add `weblogic-logging-exporter.jar` to your classpath.
122+
1. Add `weblogic-logging-exporter.jar` and `snakeyaml-1.27.jar` to your classpath.
123+
124+
This project requires `snakeyaml` to parse the YAML configuration file. If you built the project locally,
125+
you can find this JAR file in your local maven repository at `~/.m2/repository/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar`.
126+
Otherwise, you can download it from [Maven Central](https://search.maven.org/artifact/org.yaml/snakeyaml/1.27/bundle).
123127
124128
Place the file(s) in a suitable location, e.g. your domain directory.
125129
@@ -128,39 +132,46 @@ This section outlines the steps that are required to add the WebLogic Logging Ex
128132
directory is `/u01/base_domain`):
129133
130134
```
131-
export CLASSPATH="/u01/base_domain/weblogic-logging-exporter.jar:$CLASSPATH"
135+
export CLASSPATH="/u01/base_domain/weblogic-logging-exporter.jar:/u01/base_domain/snakeyaml-1.27.jar:$CLASSPATH"
132136
```
133137
134138
1. Create a configuration file for the WebLogic Logging Exporter.
135139
136-
Create a file named `WebLogicLoggingExporter.yaml` in your domain's `config` directory. You can copy the
137-
[sample provided in this project](samples/WebLogicLoggingExporter.yaml) as a starting point. That sample
138-
contains details of all of the available configuration options. A completed configuration file might look
139-
like this:
140+
There are two options currently - the version 1.x configuration, or the new version 2.x configuration - please
141+
note that the 2.x configuration is `alpha` and therefore subject to change as we get close to the 2.0 release.
140142
141-
```
142-
publishHost: localhost
143-
publishPort: 9200
144-
domainUID: domain1
145-
weblogicLoggingExporterEnabled: true
146-
weblogicLoggingIndexName: domain1-wls
147-
weblogicLoggingExporterSeverity: Notice
148-
weblogicLoggingExporterBulkSize: 1
149-
weblogicLoggingExporterFilters:
150-
- filterExpression: 'severity > Warning'
151-
```
143+
a. Version 1.x configuration
144+
145+
Create a file named `WebLogicLoggingExporter.yaml` in your domain's `config` directory. You can copy the
146+
[sample provided in this project](samples/WebLogicLoggingExporter.yaml) as a starting point. That sample
147+
contains details of all of the available configuration options. A completed configuration file might look
148+
like this:
149+
150+
```
151+
publishHost: localhost
152+
publishPort: 9200
153+
domainUID: domain1
154+
weblogicLoggingExporterEnabled: true
155+
weblogicLoggingIndexName: domain1-wls
156+
weblogicLoggingExporterSeverity: Notice
157+
weblogicLoggingExporterBulkSize: 1
158+
weblogicLoggingExporterFilters:
159+
- filterExpression: 'severity > Warning'
160+
```
161+
162+
Note that you must give a unique `domainUID` to each domain. This value is used to filter logs by domain when you
163+
send the logs from multiple domains to the same Elasticsearch server. If you are using the WebLogic Kubernetes
164+
Operator, it is strongly recommended that you use the same `domainUID` value that you use for the domain.
152165
153-
Note that you must give a unique `domainUID` to each domain. This value is used to filter logs by domain when you
154-
send the logs from multiple domains to the same Elasticsearch server. If you are using the WebLogic Kubernetes
155-
Operator, it is strongly recommended that you use the same `domainUID` value that you use for the domain.
166+
It is also strongly recommended that you consider using a different Elastcsearch index name for each domain.
156167
157-
It is also strongly recommended that you consider using a different Elastcsearch index name for each domain.
168+
b. Version 2.x configuration
158169
159-
If you prefer to place the configuration file in a different location, you can set the environment variable
160-
`WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE` to point to the location of the file.
170+
If you prefer to place the configuration file in a different location, you can set the environment variable
171+
`WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE` to point to the location of the file.
161172
162-
If you want to write the JSON logs to a file instead of sending it elasticsearch directly use the following configuration
163-
[file](samples/WebLogicFileLoggingExporter.yaml) and adjust it to your needs. Make sure to rename it to WebLogicLoggingExporter.yaml.
173+
If you want to write the JSON logs to a file instead of sending it elasticsearch directly use the following configuration
174+
[file](samples/WebLogicFileLoggingExporter.yaml) and adjust it to your needs. Make sure to rename it to WebLogicLoggingExporter.yaml.
164175
165176
6. Restart the servers to activate the changes. After restarting the servers, they will load the WebLogic
166177
Logging Exporter and start sending their logs to the specified Elasticsearch instance. You can then

Diff for: pom.xml

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
</execution>
111111
</executions>
112112
</plugin>
113+
<!--
113114
<plugin>
114115
<groupId>org.apache.maven.plugins</groupId>
115116
<artifactId>maven-assembly-plugin</artifactId>
@@ -128,6 +129,7 @@
128129
</descriptorRefs>
129130
</configuration>
130131
</plugin>
132+
-->
131133
</plugins>
132134
</build>
133135

Diff for: src/main/java/weblogic/logging/exporter/WebLogicLogFormatter.java

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
14
package weblogic.logging.exporter;
25

36
import co.elastic.logging.jul.EcsFormatter;

0 commit comments

Comments
 (0)