tomcat jsp log4j partially working

From: jw (anonymousacct2000_at_yahoo.com)
Date: 12/30/03


Date: 30 Dec 2003 08:49:37 -0800

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



Relevant Pages

  • Re: my first bean (tomcat)
    ... I have looked at the Tomcat page you indicate and I do have some idea about the architecture of a webapp and where things should go but I am a bit concerned about some of the other files which need setting. ... I am finding the doc a bit wordy to wade thru and I'd like to see a 'recipe' for getting a Bean going, the main steps, 'cos I seem to be missing/hashing one of them. ... Put the bean's class file in the webapp's WEB-INF/classes directory, or jar it up and put the jar in the webapp's WEB-INF/lib directory. ...
    (comp.lang.java.programmer)
  • myjavaserver
    ... I've an account on myjavaserver and I'start to send my work. ... My problem is that in a page I use a bean, but tomcat can't find the class. ...
    (comp.lang.java.programmer)
  • Application scope variable on startup
    ... I have my own ResourceFactory which returns a bean. ... resource factory in tomcat 5.5 context xm file. ... I would like to create a application scope variable on tomcat startup ...
    (comp.lang.java.programmer)
  • Re: path problem in tomcat
    ... what i mean is if i attach a piece of code inside the bean, ... different with start tomcat from eclipse or start it directly. ...
    (comp.lang.java.programmer)