tomcat jsp log4j partially working

J

jw

Hello,

I'm just learning log4j and I have a problem that so far I can't
find an answer to in the groups. I've got a bean that I compiled and
can run from the /classes directory that will output log messages to
stdout, FileAppender, and SocketAppender(Lumbermill). However when I
try to run that bean from a Tomcat JSP I only get the log messages to
stdout(console I started tomcat with), and no errors or other
notifications. The log4j.properties files is located under the same
/classes directory as the bean, and i've search directories/jars under
/usr/tomcat for any other log4j.properties file, but no luck. Attached
is my log4j.properties file:

#
# ROOT logger stuff. ROOT logger will output messages
# to stdout, R(file), and LogServer(RemoteServer)
#
log4j.rootLogger=debug, stdout, R, LogServer

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) -
%m%n

#
# File Appender(Attached to ROOT logger above
#
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

#
# LumberMill appender(Sends messages via socket to lumbermill
server @RemoteHost
#
log4j.appender.LogServer=org.apache.log4j.net.SocketAppender
log4j.appender.LogServer.Port=4445
log4j.appender.LogServer.RemoteHost=172.16.37.9


I'm new to JSP/Servlets and don't have a deployment descriptor(if
that's even needed in tomcat). I've chmod 777 everything under my
web-application's main directory just in case it was a permissions
thing, but still no joy.

Any ideas/help would be appreciated. Thanks in Advance.
ac
 
G

GaryM

(e-mail address removed) (jw) wrote in
Any ideas/help would be appreciated. Thanks in Advance.

Still sounds like a path problem. Have you tried explicitly configuring
the Logger a la :

PropertyConfigurator.configureAndWatch(LOG_CONFIG_FILE);

or

PropertyConfigurator.configure(LOG_CONFIG_FILE);

Remember the fully qualified config filename should be relative to the
context under which you are running within Tomcat.
 

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

Staff online

Members online

Forum statistics

Threads
473,991
Messages
2,570,217
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top