You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by jjgtx <je...@yahoo.com> on 2011/06/23 23:44:38 UTC

log4j logging works for webapps but not for server,


I can get my web applications to log with out a problem but I dont see any
messages from the tomcat server when I configure for log4j. Followed the
instrucations at http://tomcat.apache.org/tomcat-6.0-doc/logging.html
replacing the tomcat-juli.jar file in $CATALINA_HOME/bin with the one from
extras and placing the log4j.jar and tomcat-juli-adapters.jar in the lib
directory. Running with log4j debug I can see the categories registered. But
never see any output from those categories. I do see the output if I replace
the logging.properties file which causes the catalina.sh to use the default
logging.



log4j: Handling log4j.additivity.org.apache.catalina=[null]
log4j: Parsing for [org] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org set to WARN
log4j: Handling log4j.additivity.org=[null]
log4j: Parsing for
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]]
with value=[DEBUG, TOMCAT, TSOCK].
log4j: Level token is [DEBUG].
log4j: Category
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]
set to DEBUG
log4j: Parsing appender named "TOMCAT".
log4j: Appender "TOMCAT" was already parsed.
log4j: Parsing appender named "TSOCK".
log4j: Appender "TSOCK" was already parsed.
log4j: Handling
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=[null]
log4j: Parsing for
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]]
with value=[DEBUG, TOMCAT, TSOCK].
log4j: Level token is [DEBUG].
log4j: Category
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] set
to DEBUG
log4j: Parsing appender named "TOMCAT".
log4j: Appender "TOMCAT" was already parsed.
log4j: Parsing appender named "TSOCK".
log4j: Appender "TSOCK" was already parsed.
log4j: Handling
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=[null]
log4j: Finished configuring.


Any help would be appreciated.

-- 
View this message in context: http://old.nabble.com/log4j-logging-works-for-webapps-but-not-for-server%2C-tp31915060p31915060.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

Re: log4j logging works for webapps but not for server,

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 6/24/2011 12:18 PM, jjgtx wrote:
> Christopher Schultz-2 wrote:
>> Where did you put your log4j.properties file and what does it contain?
>> Can you just post the whole thing?
>
> [I put log4j.properties in] $CATALINA_HOME/lib
> 
> I hate to post the whole thing, its a bit long would it be better to send
> it?

I was mainly concerned with what you appender configuration looked like,
in case you misconfigured something there and therefore were getting no
logs due to that.

Is your configuration file similar to that described in
http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j?

Given the output on startup:

> log4j: Handling log4j.additivity.org.apache.catalina=[null]
> log4j: Parsing for [org] with value=[WARN].
> log4j: Level token is [WARN].

I suspect that log4j is actually being loaded and configured, though :)

> One thing I was curious about is that should be the value of the
> $LOGGING_CONFIG property. I used the path to the log4j file. 

I don't believe you need to set LOGGING_CONFIG to anything: I believe
LOGGING_CONFIG is only used for the JULI configuration (which is
mutually exclusive to using log4j).

Try significantly simplifying your environment and configuration:

0. Shut-down Tomcat and delete all files from logs/
1. Don't deploy any webapps... just work with Tomcat itself for now
2. Remove all appenders except for a single FileAppender,
   point that to a writable file, set the log level to INFO
3. Make sure you have:

   log4j.rootCategory=INFO,[appendername]

Start up Tomcat and see if you get anything in your log file. There
should be a few INFO messages in there.

If that doesn't work, please post your whole (simplified as described
above) log file and a complete dump of:

1. logs/catalina.out
2. logs/*   (any other files that are created on startup,
   even if they are empty)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4Ewr0ACgkQ9CaO5/Lv0PC22gCfekanthUWmdkA6SLKeGbRjVgh
SgwAnA89L6+n2KbTnn8iUIg46Ywwpg9Z
=Pn/U
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: log4j logging works for webapps but not for server,

Posted by jjgtx <je...@yahoo.com>.




Where did you put your log4j.properties file and what does it contain?
Can you just post the whole thing?
</qoute>
$CATALINA_HOME/lib

I hate to post the whole thing, its a bit long would it be better to send
it?

One thing I was curious about is that should be the value of the
$LOGGING_CONFIG property. I used the path to the log4j file. 


Christopher Schultz-2 wrote:
> 
> Also what exact version of TC 6.0 are you using? It probably doesn't
> matter but it doesn't hurt to know.
> </qoute>
> Server version: Apache Tomcat/6.0.18
> Server built:   Jul 22 2008 02:00:36
> Server number:  6.0.18.0
> OS Name:        Linux
> OS Version:     2.6.18-164.11.1.el5PAE
> Architecture:   i386
> JVM Version:    1.6.0_18-b07
> JVM Vendor:     Sun Microsystems Inc.
>  
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk4En8sACgkQ9CaO5/Lv0PDkCgCeLvl177BjdNZzldBWGrOvH/TT
> DS8AnAuxWSWKKs5E9+AL0UmS1Q6qSGnD
> =aFg+
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/log4j-logging-works-for-webapps-but-not-for-server%2C-tp31915060p31921142.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: log4j logging works for webapps but not for server,

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 6/23/2011 5:44 PM, jjgtx wrote:
> Followed the
> instructions at http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> replacing the tomcat-juli.jar file in $CATALINA_HOME/bin with the one from
> extras and placing the log4j.jar and tomcat-juli-adapters.jar in the lib
> directory. Running with log4j debug I can see the categories registered.

Where did you put your log4j.properties file and what does it contain?
Can you just post the whole thing?

Also what exact version of TC 6.0 are you using? It probably doesn't
matter but it doesn't hurt to know.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4En8sACgkQ9CaO5/Lv0PDkCgCeLvl177BjdNZzldBWGrOvH/TT
DS8AnAuxWSWKKs5E9+AL0UmS1Q6qSGnD
=aFg+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org