|
From: Leif M. <le...@ta...> - 2007-08-29 01:42:05
|
Dodrigo,
How is the -Dlog4j.debug property being set?It is not in the
wrapper.conf that you posted. You can set the following to see
the command line that the wrapper generates.
wrapper.java.command.loglevel=INFO
I can not imagine how the log files could be getting created but
not have anything written to them. That rules out a file permission
problem.
Maybe this is a class loader problem of some sort. The Wrapper
may be causing the log4j classes to be loaded and initialized
before the log4j config file is loaded? (Guessing that you are setting
log4j.debug in your code)
log4j defaults to all categories having a DEBUG log level. So them being
debug does not prove anything. Rather seeing a log level other than
DEBUG is proof that a configuration file is being found.
Another possibility is that you have two log4j config files. One forgotten
one may be in your jar and the other you are expecting to load is not
being loaded. I have seen problems like this in the past. One reason I
am not a fan of loading config files off of the class path.
Cheers,
Leif
Rodrigo Vega wrote:
> sorry i forget something... about log4j. Even the files are created...
>
>
> -----Original Message-----
> From: wra...@li... on behalf of Rodrigo Vega
> Sent: Tue 28/08/2007 21:36
> To: wra...@li...
> Subject: RE: [Wrapper-user] FW: Debian64 + log4j + wrapper
>
> I'm sure about log4j because i have setted the proeprty -Dlog4j.debug and in
> the wrapper log i can see how all the appenders and categories are created.
> Look:
>
> so01:/home/i411/software# less so/logs/de5_ss_service.log
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting property [append] to
> [true].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting property
> [datePattern] to ['.'yyyy-MM-dd].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Parsing layout of class:
> "com.i411.util.ConsoleLayout"
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting property
> [printStackTrace] to [true].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting property
> [conversionPattern] to [%d{ISO8601} %-5p [%c] %m%n].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: setFile called:
> /home/i411/software/so/logs/i411IS.log, true
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: setFile ended
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Appender [FILE] to be rolled
> at midnight.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Index].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [Data] additivity to
> [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for Data is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Data level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Data].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [API] additivity to
> [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for API is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: API level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [API].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [Plugin] additivity
> to [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for Plugin is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Plugin level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Plugin].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [Resource]
> additivity to [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for Resource is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Resource level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Resource].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [Unknown] additivity
> to [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for Unknown is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Unknown level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Unknown].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Retreiving an instance of
> org.apache.log4j.Logger.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Setting [Debug] additivity
> to [false].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Level value for Debug is
> [DEBUG].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Debug level set to DEBUG
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named
> [FILE_ADLISTENER] to category [Debug].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Adding appender named [FILE]
> to category [Debug].
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: System property is :null
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: Standard
> DocumentBuilderFactory search succeded.
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: DocumentBuilderFactory is:
> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> INFO | jvm 1 | 2007/08/28 18:40:08 | log4j: URL to log4j.dtd is
> ...
>
>
>
> Thanks for the suggestion about wild cards... i tried to do it once and it
> did not work. Maybe a was using an old version or something.
>
> Thanks for your answers... :-)
>
>
> -----Original Message-----
> From: wra...@li... on behalf of Leif Mortenson
> Sent: Tue 28/08/2007 19:48
> To: wra...@li...
> Subject: Re: [Wrapper-user] FW: Debian64 + log4j + wrapper
>
> Rodrigo,
> Why are you sure that the log4j configuration file is being loaded?
> Where do you have it? Is it embedded one of your jar files or in the
> is directory? I do not see any other way it would be loaded as you
> have not placed any other directories on your classpath nor have
> you specified a system property with the location of the log4j
> config file.
>
> There is nothing about the wrapper that would prevent log4j from
> working if its config file is being read correctly.
>
> You might want to try using wildcards in your classpath
> definitions, that would simplify things for you greatly.
>
> # Java Classpath (include wrapper.jar) Add class path elements as
> # needed starting from 1
> wrapper.java.classpath.1=../lib/wrapper.jar
> wrapper.java.classpath.2=../../../../lib/*.jar
> wrapper.java.classpath.3=../../../../conf/is/
> wrapper.java.classpath.4=../../../../../web/WEB-INF/lib/*.jar
>
> Cheers,
> Leif
>
> Rodrigo Vega wrote:
>
>> Hi guys... this is my first post in this mail list. I hope i can
>> explain well my problem.
>>
>>
>> I'm running a java application in a Debian 64 server, and my
>> application needs to create several log files. This files are very
>> important to me.
>>
>> But this is the problem, if i run the app without the wrapper all the
>> loggers are generated, but when i use the wrapper, i can see in the
>> wrapper log that the configuration for log4j is loaded but then
>> nothing is write to the files.
>>
>> I was using the same application in Windows XP/Vista/2003 and it runs
>> without any problem. I already check if the user has permission to
>> write in the log file location and all is ok.
>>
>> Can anybody help me is kind of urgent... Thanks!
>>
>> These are my configuration files.
>>
>> WRAPPER.CONF
>>
>> # Java Application
>> wrapper.java.command=java
>>
>> # Java Main class. This class must implement the WrapperListener
>> interface
>> # or guarantee that the WrapperManager class is initialized. Helper
>> # classes are provided to do this for you. See the Integration section
>> # of the documentation for details.
>> wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
>>
>> # Java Classpath (include wrapper.jar) Add class path elements as
>> # needed starting from 1
>> wrapper.java.classpath.1=../lib/wrapper.jar
>> wrapper.java.classpath.2=../../../../lib/args4j-2.0.1.jar
>> wrapper.java.classpath.3=../../../../lib/chartcreator-1.2.0-RC1.jar
>> wrapper.java.classpath.4=../../../../lib/com4j.jar
>> wrapper.java.classpath.5=../../../../lib/commons-lang-2.2.jar
>> wrapper.java.classpath.6=../../../../lib/commons-logging.jar
>> wrapper.java.classpath.7=../../../../lib/compress.jar
>> wrapper.java.classpath.8=../../../../lib/i411ad-commons.jar
>> wrapper.java.classpath.9=../../../..//lib/i411ad-listener.jar
>> wrapper.java.classpath.10=../../../../lib/i411ad-native.jar
>> wrapper.java.classpath.11=../../../../lib/ISWbem.jar
>> wrapper.java.classpath.12=../../../../lib/jcommon-1.0.0-rc1.jar
>> wrapper.java.classpath.13=../../../../lib/jdom.jar
>> wrapper.java.classpath.14=../../../../lib/jfreechart-1.0.0-rc1.jar
>> wrapper.java.classpath.15=../../../../lib/jmml.jar
>> wrapper.java.classpath.16=../../../../lib/junit.jar
>> wrapper.java.classpath.17=../../../../lib/log4j-1.2.7.jar
>> wrapper.java.classpath.18=../../../../lib/oscache-2.3.2.jar
>> wrapper.java.classpath.19=../../../../lib/tlbimp.jar
>> wrapper.java.classpath.20=../../../../lib/xercesImpl.jar
>> wrapper.java.classpath.21=../../../../lib/xml-apis.jar
>> wrapper.java.classpath.22=../../../../lib/xpp3-1.1.3.4d_b4_min.jar
>> wrapper.java.classpath.23=../../../../lib/xstream-1.1.3.jar
>>
>> # AD config files needed in claspath
>> wrapper.java.classpath.24=../../../../conf/is/
>>
>> # DE5 API reference
>> wrapper.java.classpath.25=../../../../../web/WEB-INF/lib/i411de.jar
>>
>> # Here put all custom jars nedded
>>
>>
> wrapper.java.classpath.26=../../../../../web/WEB-INF/lib/activation-1.0.2.jar
>
>> wrapper.java.classpath.27=../../../../../web/WEB-INF/lib/antlr.jar
>>
>>
> wrapper.java.classpath.28=../../../../../web/WEB-INF/lib/commons-cli-1.0.jar
>
> wrapper.java.classpath.29=../../../../../web/WEB-INF/lib/commons-codec-1.3.ja
> r
>
>> wrapper.java.classpath.30=../../../../../web/WEB-INF/lib/commons-io-1.0.jar
>>
>>
> wrapper.java.classpath.31=../../../../../web/WEB-INF/lib/commons-jxpath-1.1.j
> ar
>
> wrapper.java.classpath.32=../../../../../web/WEB-INF/lib/commons-logging-1.0.
> 4.jar
>
> wrapper.java.classpath.33=../../../../../web/WEB-INF/lib/jakarta-oro-2.0.6.ja
> r
>
>> wrapper.java.classpath.34=../../../../../web/WEB-INF/lib/javamail-1.3ea.jar
>> wrapper.java.classpath.35=../../../../../web/WEB-INF/lib/jcommon-0.9.1.jar
>> wrapper.java.classpath.36=../../../../../web/WEB-INF/lib/jdom.jar
>> wrapper.java.classpath.37=../../../../../web/WEB-INF/lib/kxml.jar
>> wrapper.java.classpath.38=../../../../../web/WEB-INF/lib/log4j-1.2.7.jar
>> wrapper.java.classpath.39=../../../../../web/WEB-INF/lib/ognl-2.6.5.jar
>> wrapper.java.classpath.40=../../../../../web/WEB-INF/lib/oscache-2.3.2.jar
>> wrapper.java.classpath.41=../../../../../web/WEB-INF/lib/pvcommons.jar
>> wrapper.java.classpath.42=../../../../../web/WEB-INF/lib/sample.jar
>> wrapper.java.classpath.43=../../../../../web/WEB-INF/lib/truelicense.jar
>> wrapper.java.classpath.44=../../../../../web/WEB-INF/lib/truexml.jar
>> wrapper.java.classpath.45=../../../../../web/WEB-INF/lib/xalan.jar
>> wrapper.java.classpath.46=../../../../../web/WEB-INF/lib/xercesImpl.jar
>> wrapper.java.classpath.47=../../../../../web/WEB-INF/lib/xml-apis.jar
>>
>> //SO Custom jars
>> wrapper.java.classpath.48=../../../../lib/jsch.jar
>> wrapper.java.classpath.49=../../../../lib/adCustoms.jar
>>
>>
>>
>>
>> # Java Library Path (location of Wrapper.DLL or libwrapper.so)
>> wrapper.java.library.path.1=../lib
>>
>> # Java Additional Parameters
>> wrapper.java.additional.1=
>>
>> # Initial Java Heap Size (in MB)
>> #wrapper.java.initmemory=3
>>
>> # Maximum Java Heap Size (in MB)
>> wrapper.java.maxmemory=512
>>
>> # Application parameters. Add parameters as needed starting from 1
>> wrapper.app.parameter.1=com.i411.ad.listener.server.Server
>>
>> #********************************************************************
>> # Wrapper Logging Properties
>> #********************************************************************
>> # Format of output for the console. (See docs for formats)
>> wrapper.console.format=PM
>>
>> # Log Level for console output. (See docs for log levels)
>> wrapper.console.loglevel=NONE
>>
>> # Log file to use for wrapper output logging.
>> wrapper.logfile=../../../../../logs/de5_ss_service.log
>>
>> # Format of output for the log file. (See docs for formats)
>> wrapper.logfile.format=LPTM
>>
>> # Log Level for log file output. (See docs for log levels)
>> wrapper.logfile.loglevel=DEBUG
>>
>> # Maximum size that the log file will be allowed to grow to before
>> # the log is rolled. Size is specified in bytes. The default value
>> # of 0, disables log rolling. May abbreviate with the 'k' (kb) or
>> # 'm' (mb) suffix. For example: 10m = 10 megabytes.
>> wrapper.logfile.maxsize=0
>>
>> # Maximum number of rolled log files which will be allowed before old
>> # files are deleted. The default value of 0 implies no limit.
>> wrapper.logfile.maxfiles=0
>>
>> # Log Level for sys/event log output. (See docs for log levels)
>> wrapper.syslog.loglevel=NONE
>>
>> #********************************************************************
>> # Wrapper Windows Properties
>> #********************************************************************
>> # Title to use when running as a console
>> wrapper.console.title=DE5 Index Engine Listener
>>
>> #********************************************************************
>> # Wrapper Windows NT/2000/XP Service Properties
>> #********************************************************************
>> # WARNING - Do not modify any of these properties when an application
>> # using this configuration file has been installed as a service.
>> # Please uninstall the service before modifying this section. The
>> # service can then be reinstalled.
>>
>> # Name of the service
>> wrapper.ntservice.name=de5_index_engine
>>
>> # Display name of the service
>> wrapper.ntservice.displayname=DE5 Index Engine Listener
>>
>> # Description of the service
>> wrapper.ntservice.description=DE5 Index Engine Listener
>>
>> # Service dependencies. Add dependencies as needed starting from 1
>> wrapper.ntservice.dependency.1=
>>
>> # Mode in which the service is installed. AUTO_START or DEMAND_START
>> wrapper.ntservice.starttype=DEMAND_START
>>
>> # Allow the service to interact with the desktop.
>> wrapper.ntservice.interactive=false
>>
>> wrapper.ntservice.process_priority=REALTIMEs
>>
|