public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
map.put("Привет", "Это выводим если пользователь ввел Привет");
map.put("Пока", "Это выводим если пользователь ввел Пока");
Scanner scanner = new Scanner(System.in);
while (true){
String s = map.get(scanner.nextLine());
if (s != null) {
System.out.println(s);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="Appender" class="org.apache.log4j.FileAppender">
<param name="File" value="logs/logs.txt" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%p %d %C{1}/[%t] %x - (%m)%n"/>
</layout>
</appender>
<appender name="console" class="org.apache.log4j.Layout">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%p %c: %m%n"/></layout>
</appender>
<root>
<priority value="TRACE"/>
<appender-ref ref="Appender" />
</root>
</log4j:configuration>