File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 23
23
# WINDOWS_OS_FORMAT == 1 if Cygwin or MinGW is detected, else 0.
24
24
if [[ $( uname -a) =~ " CYGWIN" || $( uname -a) =~ " MINGW" || $( uname -a) =~ " MSYS" ]]; then
25
25
WINDOWS_OS_FORMAT=1
26
- export MSYS2_ARG_CONV_EXCL=" -Xlog:gc*:file=;-Dlog4j.configuration =;$MSYS2_ARG_CONV_EXCL "
26
+ export MSYS2_ARG_CONV_EXCL=" -Xlog:gc*:file=;-Dlog4j2.configurationFile =;$MSYS2_ARG_CONV_EXCL "
27
27
else
28
28
WINDOWS_OS_FORMAT=0
29
29
fi
220
220
# Log4j settings
221
221
if [ -z " $KAFKA_LOG4J_OPTS " ]; then
222
222
# Log to console. This is a tool.
223
- LOG4J_DIR=" $base_dir /config/tools-log4j.properties "
223
+ LOG4J_DIR=" $base_dir /config/tools-log4j2.yaml "
224
224
# If Cygwin is detected, LOG4J_DIR is converted to Windows format.
225
225
(( WINDOWS_OS_FORMAT )) && LOG4J_DIR=$( cygpath --path --mixed " ${LOG4J_DIR} " )
226
- KAFKA_LOG4J_OPTS=" -Dlog4j.configuration=file: ${LOG4J_DIR} "
226
+ KAFKA_LOG4J_OPTS=" -Dlog4j2.configurationFile= ${LOG4J_DIR} "
227
227
else
228
228
if echo " $KAFKA_LOG4J_OPTS " | grep -E " log4j\.[^[:space:]]+(\.properties|\.xml)$" ; then
229
229
# Enable Log4j 1.x configuration compatibility mode for Log4j 2
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ IF ["%LOG_DIR%"] EQU [""] (
116
116
117
117
rem Log4j settings
118
118
IF [" %KAFKA_LOG4J_OPTS% " ] EQU [" " ] (
119
- set KAFKA_LOG4J_OPTS = -Dlog4j.configuration =file:%BASE_DIR% /config/tools-log4j.properties
119
+ set KAFKA_LOG4J_OPTS = -Dlog4j2.configurationFile =file:%BASE_DIR% /config/tools-log4j2.yaml
120
120
) ELSE (
121
121
rem Check if Log4j 1.x configuration options are present in KAFKA_LOG4J_OPTS
122
122
echo %KAFKA_LOG4J_OPTS% | findstr /r /c:" log4j\.[^ ]*(\.properties|\.xml)$" > nul
Original file line number Diff line number Diff line change 12
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
+ Configuration :
16
+ Properties :
17
+ Property :
18
+ - name : " logPattern"
19
+ value : " [%d] %p %m (%c)%n"
15
20
16
- log4j.rootLogger =WARN, stderr
21
+ Appenders :
22
+ Console :
23
+ name : STDERR
24
+ target : SYSTEM_ERR
25
+ PatternLayout :
26
+ pattern : " ${logPattern}"
27
+ Loggers :
28
+ Root :
29
+ level : WARN
30
+ AppenderRef :
31
+ - ref : STDERR
17
32
18
- log4j.appender.stderr =org.apache.log4j.ConsoleAppender
19
- log4j.appender.stderr.layout =org.apache.log4j.PatternLayout
20
- log4j.appender.stderr.layout.ConversionPattern =[%d] %p %m (%c)%n
21
- log4j.appender.stderr.Target =System.err
You can’t perform that action at this time.
0 commit comments