File tree Expand file tree Collapse file tree 5 files changed +32
-2
lines changed
core/src/main/java/com/dtstack/flink/sql/option
src/main/java/com/dtstack/flink/sql/launcher Expand file tree Collapse file tree 5 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,11 @@ sh submit.sh -sql D:\sideSql.txt -name xctest -remoteSqlPluginPath /opt/dtstack
181181 * 描述:yarn session 模式下指定的运行的一些参数,[可参考](https://ci.apache.org/projects/flink/flink-docs-release-1.8/ops/cli.html),目前只支持指定yid
182182 * 必选:否
183183 * 默认值:false
184+
185+ * ** logLevel**
186+ * 描述:设定日志级别
187+ * 必选:否
188+ * 默认值:info
184189
185190## 2 结构
186191### 2.1 源表插件
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ public class Options {
6868
6969 @ OptionRequired (description = "plugin load mode, by classpath or shipfile" )
7070 private String pluginLoadMode = EPluginLoadMode .CLASSPATH .name ();
71+
72+ @ OptionRequired (description = "log level" )
73+ private String logLevel = "info" ;
7174
7275 public String getMode () {
7376 return mode ;
@@ -173,4 +176,11 @@ public void setPluginLoadMode(String pluginLoadMode) {
173176 this .pluginLoadMode = pluginLoadMode ;
174177 }
175178
179+ public String getLogLevel () {
180+ return logLevel ;
181+ }
182+
183+ public void setLogLevel (String logLevel ) {
184+ this .logLevel = logLevel ;
185+ }
176186}
Original file line number Diff line number Diff line change 1010 <modelVersion >4.0.0</modelVersion >
1111
1212 <artifactId >sql.launcher</artifactId >
13-
1413 <dependencies >
1514 <dependency >
1615 <groupId >com.dtstack.flink</groupId >
3534 <artifactId >fastjson</artifactId >
3635 <version >1.2.7</version >
3736 </dependency >
38-
37+ <dependency >
38+ <groupId >com.aiweiergou</groupId >
39+ <artifactId >tools-logger</artifactId >
40+ <version >${logger.tool.version} </version >
41+ </dependency >
3942 </dependencies >
4043
4144 <build >
Original file line number Diff line number Diff line change 2020
2121package com .dtstack .flink .sql .launcher ;
2222
23+ import com .aiweiergou .tool .logger .api .ChangeLogLevelProcess ;
2324import com .dtstack .flink .sql .constrant .ConfigConstrant ;
2425import com .google .common .collect .Lists ;
2526import com .alibaba .fastjson .JSON ;
@@ -83,6 +84,8 @@ public static void main(String[] args) throws Exception {
8384 confProp = URLDecoder .decode (confProp , Charsets .UTF_8 .toString ());
8485 Properties confProperties = PluginUtil .jsonStrToObject (confProp , Properties .class );
8586
87+ setLogLevel (launcherOptions .getLogLevel ());
88+
8689 if (mode .equals (ClusterMode .local .name ())) {
8790 String [] localArgs = argList .toArray (new String [argList .size ()]);
8891 Main .main (localArgs );
@@ -146,4 +149,12 @@ private static String[] parseJson(String[] args) {
146149 String [] array = list .toArray (new String [list .size ()]);
147150 return array ;
148151 }
152+
153+ private static void setLogLevel (String logLevel ){
154+ if (org .apache .commons .lang3 .StringUtils .isBlank (logLevel )){
155+ return ;
156+ }
157+ ChangeLogLevelProcess logLevelProcess = new ChangeLogLevelProcess ();
158+ logLevelProcess .process (logLevel );
159+ }
149160}
Original file line number Diff line number Diff line change 4141 <properties >
4242 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
4343 <flink .version>1.8.1</flink .version>
44+ <logger .tool.version>1.0.0-SNAPSHOT</logger .tool.version>
4445 </properties >
4546
4647 <build >
You can’t perform that action at this time.
0 commit comments