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

Commit

Permalink
Merge pull request #16 from sdeangel/issue-9-fix
Browse files Browse the repository at this point in the history
Issue 9 Fix
  • Loading branch information
rjeberhard authored Jan 21, 2021
2 parents 62e6c51 + 8a591b1 commit f77f6f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
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

0 comments on commit f77f6f0

Please # to comment.