a logger question

L

laredotornado

Hi,

Using log4j, I'm trying to log a test message in my JSF page. But
it's not printing to my log file. What I have is

java.util.logging.Logger logger =
java.util.logging.Logger.getLogger("MyClass");
logger.info("Hi there.");

and below is my config file. I have verified that "/path/to/log" is
in my classpath. Any other ideas why I'm not seeing the message "Hi
there" in my log? I'm sure it's something really obviousl

Thanks, - Dave


====================Begin log4j properties
file==================================
Log4j configuration file.

log4j.category.NPSPortalLog=DEBUG, A2
! DO NOT want additivity for this category
log4j.additivity.NPSPortalLog=false

# Available levels are DEBUG, INFO, WARN, ERROR, FATAL
#
#
# A2 is a DailyRollingFileAppender
#

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=/path/to/log/nps_config_gui.log
log4j.appender.A2.datePattern='.'yyyy-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} - [%C::%M]
- %m%n
=======================End log 4j properties
file=================================
 
A

Arne Vajhøj

laredotornado said:
Using log4j, I'm trying to log a test message in my JSF page. But
it's not printing to my log file. What I have is

java.util.logging.Logger logger = java.util.logging.Logger.getLogger("MyClass");
logger.info("Hi there.");

and below is my config file. I have verified that "/path/to/log" is
in my classpath. Any other ideas why I'm not seeing the message "Hi
there" in my log? I'm sure it's something really obviousl
====================Begin log4j properties file==================================
Log4j configuration file.

log4j.category.NPSPortalLog=DEBUG, A2
! DO NOT want additivity for this category
log4j.additivity.NPSPortalLog=false

# Available levels are DEBUG, INFO, WARN, ERROR, FATAL
#
#
# A2 is a DailyRollingFileAppender
#

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=/path/to/log/nps_config_gui.log
log4j.appender.A2.datePattern='.'yyyy-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} - [%C::%M] - %m%n
=======================End log 4j properties file=================================

log4j.appender.A2.threshold = info

maybe ?

I assume that:

MyClass = NPSPortalLog

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top