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

Commit f77f6f0

Browse files
authored
Merge pull request #16 from sdeangel/issue-9-fix
Issue 9 Fix
2 parents 62e6c51 + 8a591b1 commit f77f6f0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ This section outlines the steps that are required to add the Weblogic Logging Ex
161161
It is also strongly recommended that you consider using a different Elastcsearch index name for each domain.
162162
163163
If you prefer to place the configuration file in a different location, you can set the environment variable
164-
`WEBLOGIC_LOGGING_EXPORTE_CONFIG_FILE` to point to the location of the file.
164+
`WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE` to point to the location of the file.
165165
166166
1. Restart the servers to activate the changes. After restarting the servers, they will load the WebLogic
167167
Logging Exporter and start sending their logs to the specified Elasticsearch instance. You can then

src/main/java/weblogic/logging/exporter/Startup.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ public static void main(String[] argv) {
2727
If the file doesn't exist, give WARNING, and use default.
2828
It is assumed that when this is integrated to Operator, the system variable will be set.
2929
*/
30+
3031
String fileName =
31-
System.getProperty("WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE", DEFAULT_CONFIG_FILE);
32+
System.getProperty(
33+
"WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE",
34+
System.getenv("WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE"));
35+
System.out.println(
36+
"JavaProperty/EnvVariable WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE:" + fileName);
37+
if (fileName == null || fileName.isEmpty()) {
38+
System.out.println(
39+
"Env variable WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE is not set. Defaulting to:"
40+
+ DEFAULT_CONFIG_FILE);
41+
fileName = DEFAULT_CONFIG_FILE;
42+
}
3243
File file = new File(fileName);
3344
System.out.println("Reading configuration from file name: " + file.getAbsolutePath());
3445
Config config = Config.loadConfig(file);

0 commit comments

Comments
 (0)