diff --git a/apm-dist/bin/webappService.bat b/apm-dist/bin/webappService.bat index 22f182d72512ae196ca9cc70052d423824b357f0..22dd6e917ed105bf0a2e35176cc94f5163ea1583 100644 --- a/apm-dist/bin/webappService.bat +++ b/apm-dist/bin/webappService.bat @@ -20,6 +20,13 @@ setlocal set WEBAPP_PROCESS_TITLE=Skywalking-Webapp set WEBAPP_HOME=%~dp0%.. set JARPATH=%WEBAPP_HOME%\webapp +set WEBAPP_LOG_DIR=%WEBAPP_HOME%\logs + +if exist "%WEBAPP_LOG_DIR%" ( + mkdir "%WEBAPP_LOG_DIR%" +) + +set LOG_FILE_LOCATION=%WEBAPP_LOG_DIR%\webapp.log if defined JAVA_HOME ( set _EXECJAVA="%JAVA_HOME:"=%"\bin\java @@ -30,5 +37,5 @@ if not defined JAVA_HOME ( set _EXECJAVA=java ) -start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA% -jar %JARPATH%/skywalking-webapp.jar --server.port=8080 --collector.ribbon.listOfServers=127.0.0.1:10800 +start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA% -jar %JARPATH%/skywalking-webapp.jar --server.port=8080 --collector.ribbon.listOfServers=127.0.0.1:10800 --logging.file=%LOG_FILE_LOCATION% endlocal diff --git a/apm-dist/bin/webappService.sh b/apm-dist/bin/webappService.sh index c915ff2516561a7e8d4d43083491ab625fd55a0a..fdd52c48bc96b740d2f7c568745704d400863001 100644 --- a/apm-dist/bin/webappService.sh +++ b/apm-dist/bin/webappService.sh @@ -28,12 +28,15 @@ if [ ! -d "${WEBAPP_HOME}/logs" ]; then mkdir -p "${WEBAPP_LOG_DIR}" fi +LOG_FILE_LOCATION=${WEBAPP_LOG_DIR}/webapp.log + _RUNJAVA=${JAVA_HOME}/bin/java [ -z "$JAVA_HOME" ] && _RUNJAVA=java eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} -jar ${JAR_PATH}/skywalking-webapp.jar \ --server.port=8080 --collector.ribbon.listOfServers=127.0.0.1:10800 \ - 2>${WEBAPP_LOG_DIR}/webapp.log 1> /dev/null &" + --logging.file=${LOG_FILE_LOCATION} \ + 2>${WEBAPP_LOG_DIR}/webapp-console.log 1> /dev/null &" if [ $? -eq 0 ]; then sleep 1 diff --git a/apm-webapp/src/main/resources/logback-spring.xml b/apm-webapp/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000000000000000000000000000000000..3e017a7762e2448f2104e99282b139a0504d7ab3 --- /dev/null +++ b/apm-webapp/src/main/resources/logback-spring.xml @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file