2013/1/28 Tiago Sousa <tiago-a-so...@ext.ptinovacao.pt>: > Em 25/01/2013 19:39, Christopher Schultz escreveu: >> >> On 1/25/13 4:45 AM, Tiago Sousa wrote: >>> >>> Em 25/01/2013 08:59, Konstantin Kolinko escreveu: >>>> >>>> 2013/1/24 Tiago Sousa <tiago-a-so...@ext.ptinovacao.pt>: >>>>> >>>>> Hello to all. >>>>> >>>>> I have tomcat 6 >>>> >>>> Which version? >>> >>> I'm using tomcat 6.0.16. >>>> >>>> Did you install it from a zip file downloaded from >>>> tomcat.apache.org? >>> >>> Yes, i installed using a zip file downloaded from >>> tomcat.apache.org. >>> >>>> using JULI for logging (logging.properties in conf dir) plus >>>> several webapps using its own log4j.properties. >>>> >>>> I need to centralized all the logs so i thought to put a >>>> global/shared log4j.properties in $CATALINA_BASE\lib so that >>>> tomcat and each webapp can be controlled through this file. OK, >>>> but make sure that all jars are in their proper places. >>>> Sometimes people read the doc incorrectly. >>>> >>>> http://tomcat.apache.org/tomcat-6.0-doc/logging.html >>> >>> Ok, i think i've done it, namely: >>> >>> * Put|log4j.jar|and|tomcat-juli-adapters.jar|from "extras" >>> into|$CATALINA_HOME/lib|. * >>> Replace|$CATALINA_HOME/bin/tomcat-juli.jar|with|tomcat-juli.jar|from >>> >>> >> "extras". >>> >>> >>> The problem i'm facing is that no logs are produced. At this time >>> i'm trying to configure just TOMCAT, no webapps, to log through >>> log4j but still no logs are produced. I've folowed the tutorial in >>> Apache logging webpage with the standard log4j.properties. No logs >>> in $CATALINA_BASE\logs. >>>> >>>> Which tutorial did you follow? >>> >>> The one you mentioned: >>> http://tomcat.apache.org/tomcat-6.0-doc/logging.html >>>> >>>> Did you configure them to be written to "${catalina.base}/logs" >>>> ? Maybe it tries to write them elsewhere? >>> >>> It is configured in its standard version ( >>> http://tomcat.apache.org/tomcat-6.0-doc/logging.html), which i am >>> using. >>>> >>>> Is the file readable? >>> >>> There is no file, tomcat does not create one and that is my >>> problem. >> >> I think Konstantin meant "is the config file readable" or perhaps "is >> the logs/ directory writable". Of course, all permissions must be >> relative to the effective uid running Tomcat. >> >> Check catalina.out. If you don't have a log4j.properties file (or >> similar) available, I believe you'll get a message on stdout saying >> "You haven't configured log4j properly" and you won't get any further >> log messages anywhere. >> >> > Hi... > > Just a final tip, i´m using log4j-api-2.0-beta3 as my log4j.jar (without > renaming it). > Any problem with that? >
File name is not a problem, but using a wrong version of the library is a problem. There are a couple of issues to start 1. The Apache Commons Logging library is designed and compiled to use Log4J 1.x Log4J 2 docs say that you need an adapter to use it with Commons Logging. (I have not used it yet so I do not know what mileage is here). YMMV. 2. "log4j.properties" is not a valid configuration file for log4j 2. Its configuration files are either XML or JSON. http://logging.apache.org/log4j/2.x/manual/configuration.html Try with 1.2.17 http://logging.apache.org/log4j/1.2/download.html Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org