Есть два проперти файла:
first.properties:
log4j.category.RedChief=INFO, STDOUT
log4j.category.OldHank=INFO, STDOUT
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%c - %m%n
second.properties:
log4j.category.OldHank=DEBUG, STDOUT
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%c - %m%n
Что будет выведено на консоль после выполнения следующего кода?
package org.redchief;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
public class Story {
private static final Logger oldHank = Logger.getLogger("OldHank");
private static final Logger redChief = Logger.getLogger("RedChief");
public static void main(String[] args) {
PropertyConfigurator.configure("first.properties");
oldHank.info("I'm Old Hank, the Trapper!");
redChief.info("Ha! cursed paleface!");
PropertyConfigurator.configure("second.properties");
oldHank.info("What am I to do?");
redChief.info("You are the hoss!");
}
}
Варианты ответов:
1) OldHank - I'm Old Hank, the Trapper!
RedChief - Ha! cursed paleface!
OldHank - What am I to do?
RedChief - You are the hoss!
2) log4j:WARN No such property [STDOUT] in some appender or layout.
3) OldHank - I'm Old Hank, the Trapper!
RedChief - Ha! cursed paleface!
OldHank - What am I to do?
log4j:ERROR Attempted to append to closed appender named [STDOUT].
4) Конфигурировать log4j можно только один раз.
5) Что-то другое.
Есть два проперти файла:
first.properties:
log4j.category.RedChief=INFO, STDOUT
log4j.category.OldHank=INFO, STDOUT
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%c - %m%n
second.properties:
log4j.category.OldHank=DEBUG, STDOUT
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%c - %m%n
Что будет выведено на консоль после выполнения следующего кода?
package org.redchief;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
public class Story {
private static final Logger oldHank = Logger.getLogger("OldHank");
private static final Logger redChief = Logger.getLogger("RedChief");
public static void main(String[] args) {
PropertyConfigurator.configure("first.properties");
oldHank.info("I'm Old Hank, the Trapper!");
redChief.info("Ha! cursed paleface!");
PropertyConfigurator.configure("second.properties");
oldHank.info("What am I to do?");
redChief.info("You are the hoss!");
}
}
Варианты ответов:
1) OldHank - I'm Old Hank, the Trapper!
RedChief - Ha! cursed paleface!
OldHank - What am I to do?
RedChief - You are the hoss!
2) log4j:WARN No such property [STDOUT] in some appender or layout.
3) OldHank - I'm Old Hank, the Trapper!
RedChief - Ha! cursed paleface!
OldHank - What am I to do?
log4j:ERROR Attempted to append to closed appender named [STDOUT].
4) Конфигурировать log4j можно только один раз.
5) Что-то другое.