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

Issue 9 Fix #16

Merged
merged 1 commit into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ This section outlines the steps that are required to add the Weblogic Logging Ex
It is also strongly recommended that you consider using a different Elastcsearch index name for each domain.

If you prefer to place the configuration file in a different location, you can set the environment variable
`WEBLOGIC_LOGGING_EXPORTE_CONFIG_FILE` to point to the location of the file.
`WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE` to point to the location of the file.

1. 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
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/weblogic/logging/exporter/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ public static void main(String[] argv) {
If the file doesn't exist, give WARNING, and use default.
It is assumed that when this is integrated to Operator, the system variable will be set.
*/

String fileName =
System.getProperty("WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE", DEFAULT_CONFIG_FILE);
System.getProperty(
"WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE",
System.getenv("WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE"));
System.out.println(
"JavaProperty/EnvVariable WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE:" + fileName);
if (fileName == null || fileName.isEmpty()) {
System.out.println(
"Env variable WEBLOGIC_LOGGING_EXPORTER_CONFIG_FILE is not set. Defaulting to:"
+ DEFAULT_CONFIG_FILE);
fileName = DEFAULT_CONFIG_FILE;
}
File file = new File(fileName);
System.out.println("Reading configuration from file name: " + file.getAbsolutePath());
Config config = Config.loadConfig(file);
Expand Down