Skip to content

Commit

Permalink
[FLINK-16243][docs] Update quickstarts to Log4j2
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Feb 23, 2020
1 parent 7b88951 commit 8bb14b8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
14 changes: 8 additions & 6 deletions docs/getting-started/project-setup/java_api_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ quickstart/
│   ├── BatchJob.java
│   └── StreamingJob.java
└── resources
└── log4j.properties
└── log4j2.properties
{% endhighlight %}

The sample project is a __Maven project__, which contains two classes: _StreamingJob_ and _BatchJob_ are the basic skeleton programs for a *DataStream* and *DataSet* program.
Expand Down Expand Up @@ -180,7 +180,7 @@ ext {
flinkVersion = '{{ site.version }}'
scalaBinaryVersion = '{{ site.scala_version }}'
slf4jVersion = '1.7.7'
log4jVersion = '1.2.17'
log4jVersion = '2.12.1'
}


Expand All @@ -190,7 +190,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
applicationDefaultJvmArgs = ["-Dlog4j.configurationFile=log4j2.properties"]

task wrapper(type: Wrapper) {
gradleVersion = '3.1'
Expand All @@ -213,7 +213,7 @@ configurations {
flinkShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
flinkShadowJar.exclude group: 'org.slf4j'
flinkShadowJar.exclude group: 'log4j'
flinkShadowJar.exclude group: 'org.apache.logging.log4j'
}

// declare the dependencies for your production and test code
Expand All @@ -231,7 +231,9 @@ dependencies {
// --------------------------------------------------------------
//flinkShadowJar "org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"

compile "log4j:log4j:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-api:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-core:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"

// Add test dependencies here.
Expand Down Expand Up @@ -301,7 +303,7 @@ quickstart/
│   ├── BatchJob.java
│   └── StreamingJob.java
└── resources
└── log4j.properties
└── log4j2.properties
{% endhighlight %}

The sample project is a __Gradle project__, which contains two classes: _StreamingJob_ and _BatchJob_ are the basic skeleton programs for a *DataStream* and *DataSet* program.
Expand Down
14 changes: 8 additions & 6 deletions docs/getting-started/project-setup/java_api_quickstart.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ quickstart/
│   ├── BatchJob.java
│   └── StreamingJob.java
└── resources
└── log4j.properties
└── log4j2.properties
{% endhighlight %}

示例项目是一个 __Maven project__,它包含了两个类:_StreamingJob__BatchJob_ 分别是 *DataStream* and *DataSet* 程序的基础骨架程序。
Expand Down Expand Up @@ -176,7 +176,7 @@ ext {
flinkVersion = '{{ site.version }}'
scalaBinaryVersion = '{{ site.scala_version }}'
slf4jVersion = '1.7.7'
log4jVersion = '1.2.17'
log4jVersion = '2.12.1'
}


Expand All @@ -186,7 +186,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
applicationDefaultJvmArgs = ["-Dlog4j.configurationFile=log4j2.properties"]

task wrapper(type: Wrapper) {
gradleVersion = '3.1'
Expand All @@ -208,7 +208,7 @@ configurations {
flinkShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
flinkShadowJar.exclude group: 'org.slf4j'
flinkShadowJar.exclude group: 'log4j'
flinkShadowJar.exclude group: 'org.apache.logging.log4j'
}

// declare the dependencies for your production and test code
Expand All @@ -226,7 +226,9 @@ dependencies {
// --------------------------------------------------------------
//flinkShadowJar "org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"

compile "log4j:log4j:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-api:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-core:${log4jVersion}"
compile "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"

// Add test dependencies here.
Expand Down Expand Up @@ -293,7 +295,7 @@ quickstart/
│   ├── BatchJob.java
│   └── StreamingJob.java
└── resources
└── log4j.properties
└── log4j2.properties
{% endhighlight %}

示例项目是一个 __Gradle 项目__,它包含了两个类:_StreamingJob__BatchJob_*DataStream**DataSet* 程序的基础骨架程序。
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/project-setup/scala_api_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ quickstart/
└── src
└── main
├── resources
│   └── log4j.properties
│   └── log4j2.properties
└── scala
└── org
└── myorg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ quickstart/
└── src
└── main
├── resources
│   └── log4j.properties
│   └── log4j2.properties
└── scala
└── org
└── myorg
Expand Down

0 comments on commit 8bb14b8

Please sign in to comment.