ppkarwasz commented on code in PR #17373:
URL: https://github.com/apache/kafka/pull/17373#discussion_r1819769400
##########
bin/kafka-server-start.sh:
##########
@@ -22,7 +22,7 @@ fi
base_dir=$(dirname $0)
if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then
- export
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"
Review Comment:
The switch from the legacy to the new configuration format can be based on
the presence of specific files:
```shell
if [ -f "$base_dir/../config/log4j.properties" ]; then
echo DEPRECATED: Using Log4j 1.x configuration file
\$KAFKA_HOME/config/log4j.properties >&2
echo To use a Log4j 2.x configuration, create a
\$KAFKA_HOME/config/log4j2.xml file and remove the Log4j 1.x configration. >&2
echo See
https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html#Log4j2ConfigurationFormat
for details about Log4j configuration file migration. >&2
export
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"
elif [ -f "$base_dir/../config/log4j2.xml" ]; then
export
KAFKA_LOG4J_OPTS="-Dlog4j2.configurationFile=$base_dir/../config/log4j2.xml"
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]