[英]Logger.info does not write anything to console
Hi my code is as below - 嗨,我的代码如下-
public class testSmthing extends Base{
private Logger logger = Logger.getLogger(TestFirewallACL.class);
@BeforeMethod(alwaysRun = true)
public void setUp()
{
try
{
//logger.setLevel(Level.DEBUG);
logger.info("Initializing Client");
super.setUp();
}
catch(Throwable e)
{
//
}
}
@Test(groups="test")
public void testSmthing()
{
String payload = getPayload("d.xml");
}
}
My question is when i am running this i am not able to see whatever is written in logger.info. 我的问题是,当我运行此程序时,我看不到logger.info中写的内容。 Is there something else that i need to do.
还有什么我需要做的。
Added the log4j.properties in classpath 在类路径中添加了log4j.properties
# For the general syntax of propperty based configuration files see
# the documenation of org.apache.log4j.PropertyConfigurator.
# The root category uses two appenders: default.out and default.file.
# The first one gathers all log output, the latter only starting with
# the priority INFO.
# The root priority is DEBUG, so that all classes can be logged unless
# defined otherwise in more specific properties.
log4j.rootLogger=DEBUG, default.out, default.file
# System.out.println appender for all classes
log4j.appender.default.out=org.apache.log4j.ConsoleAppender
log4j.appender.default.out.threshold=DEBUG
log4j.appender.default.out.layout=org.apache.log4j.PatternLayout
log4j.appender.default.out.layout.ConversionPattern=%-5p %c: %m%n
log4j.appender.default.file=org.apache.log4j.FileAppender
log4j.appender.default.file.append=true
log4j.appender.default.file.file=/log/mylogfile.log
log4j.appender.default.file.threshold=INFO
log4j.appender.default.file.layout=org.apache.log4j.PatternLayout
log4j.appender.default.file.layout.ConversionPattern=%-5p %c: %m%n
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.