Skip to content

WDT-644 write log file path to tool startup stdout logs #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 11, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ public WLSDeployLoggingConfig() {
System.exit(ERROR_EXIT_CODE);
}
PlatformLogger logger = WLSDeployLogFactory.getLogger(WLSDEPLOY_LOGGER_NAME); // make sure that this is the first logger
logger.info("The {0} program will write its log to {1}", programName, logFileName);
}

/**
Expand All @@ -168,6 +167,15 @@ public static synchronized File getLoggingDirectory() {
return new File(loggingDirectory.getAbsolutePath());
}

/**
* Log the logging directory path
*
*/
public static void logLoggingDirectory(String programName) {
PlatformLogger logger = WLSDeployLogFactory.getLogger(WLSDEPLOY_LOGGER_NAME);
logger.info("WLSDPLY-01755", programName, loggingDirectory.getAbsolutePath());
}

/**
* Get the logging.properties file.
*
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from java.lang import System
from oracle.weblogic.deploy.create import CreateException
from oracle.weblogic.deploy.deploy import DeployException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import FileUtils
from oracle.weblogic.deploy.util import WLSDeployArchiveIOException
Expand Down Expand Up @@ -379,6 +380,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from oracle.weblogic.deploy.deploy import DeployException
from oracle.weblogic.deploy.exception import BundleAwareException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion

Expand Down Expand Up @@ -261,6 +262,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from oracle.weblogic.deploy.aliases import AliasException
from oracle.weblogic.deploy.discover import DiscoverException
from oracle.weblogic.deploy.json import JsonException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import FileUtils
from oracle.weblogic.deploy.util import PyOrderedDict
Expand Down Expand Up @@ -641,6 +642,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from java.lang import String, System

from oracle.weblogic.deploy.encrypt import EncryptionException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import TranslateException
from oracle.weblogic.deploy.util import VariableException
Expand Down Expand Up @@ -255,6 +256,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/extract_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys

from oracle.weblogic.deploy.deploy import DeployException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion

Expand Down Expand Up @@ -160,6 +161,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/model_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import sys

from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion

Expand Down Expand Up @@ -451,6 +452,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/prepare_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
import traceback

from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import PyWLSTException
from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion
Expand Down Expand Up @@ -111,6 +112,7 @@ def main():

if __name__ == "__main__" or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main()
except exceptions.SystemExit, ex:
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys

from oracle.weblogic.deploy.deploy import DeployException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.exception import BundleAwareException
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion
Expand Down Expand Up @@ -311,6 +312,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
1 change: 1 addition & 0 deletions core/src/main/python/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from java.util.logging import Level

from oracle.weblogic.deploy.logging import WLSDeployLogEndHandler
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import TranslateException
from oracle.weblogic.deploy.util import VariableException
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/python/variable_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from java.io import File
from java.lang import IllegalArgumentException
from oracle.weblogic.deploy.logging import WLSDeployLoggingConfig
from oracle.weblogic.deploy.util import CLAException
from oracle.weblogic.deploy.util import FileUtils
from oracle.weblogic.deploy.util import TranslateException
Expand Down Expand Up @@ -206,6 +207,7 @@ def main(args):

if __name__ == '__main__' or __name__ == 'main':
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
WLSDeployLoggingConfig.logLoggingDirectory(_program_name)
try:
main(sys.argv)
except exceptions.SystemExit, ex:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ WLSDPLY-01746=Invalid token syntax for {0} value "{1}", should match "{2}"
# oracle.weblogic.deploy.util.WebLogicDeployToolingVersion.java (in src/main/resources/templates)
WLSDPLY-01750=The WebLogic Deploy Tooling {0} version is {1}

# oracle.weblogic.deploy.logging.WLSDeployLoggingConfig.java
WLSDPLY-01755=The {0} program will write its log to directory {1}

# logger_test.py
WLSDPLY-01760=Failed to access key in map: {0}

Expand Down