Re: Log4J + Torque ... gonna drive me mad.

"Will Glass-Husain" <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <[email protected]>
sorry, emailed too soon.  more to the point, you can search all the
jars with a simple bash script.

 (for i in `find . -name '*.jar'`; do echo $i; unzip -t $i | grep
.properties; done) > ../properties.txt

WILL

On Wed, Jul 30, 2008 at 1:13 PM, Will Glass-Husain
<[email protected]> wrote:
> Had the same issue; I think with Axis.  It had log4j.properties in the
> jar.  I had to rebuild the jar to remove it.
>
> WILL
>
> On Wed, Jul 30, 2008 at 10:35 AM, Alvaro Coronel
> <[email protected]> wrote:
>> Check the JAR files you are using. I vaguely recall finding a .properties file that caused the same problem and drove me mad.
>>
>> FYI, madness receded after I solved it - so good luck!
>>
>> Álvaro
>>
>> --- On Wed, 7/30/08, Shinkan <[email protected]> wrote:
>> From: Shinkan <[email protected]>
>> Subject: Re: Log4J + Torque ... gonna drive me mad.
>> To: "Apache Torque Users List" <[email protected]>
>> Date: Wednesday, July 30, 2008, 12:59 PM
>>
>> No way .. I tried putting it everywhere on my project classpath referenced
>> dirs.
>> Same errors :
>> "log4j:WARN No appenders could be found for logger
>> (org.apache.torque.TorqueInstance).
>> log4j:WARN Please initialize the log4j system properly."
>>
>> Here is my exact log4j.properties file:
>>
>> log4j.category.org.apache.torque = ALL, org.apache.torque
>> log4j.appender.org.apache.torque = org.apache.log4j.RollingFileAppender
>> log4j.appender.org.apache.torque.file = log/data.log
>> log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
>> log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c
>> - %m%n
>> log4j.appender.org.apache.torque.maxBackupIndex = 1
>> log4j.appender.org.apache.torque.maxFileSize = 5MB
>> log4j.appender.org.apache.torque.append = true
>>
>>
>> On Wed, Jul 30, 2008 at 17:34, David Beukes <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I needed to take the log4j settings out of Torque.properties and put them
>>> in a separate log4j.properties file:
>>>
>>>  log4j.category.org.apache.torque = ALL, org.apache.torque
>>>> log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
>>>> log4j.appender.org.apache.torque.file = c:/torque.log
>>>> log4j.appender.org.apache.torque.layout =
>> org.apache.log4j.PatternLayout
>>>> log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t]
>> %-5p
>>>> %c - %m%n
>>>> log4j.appender.org.apache.torque.append = false
>>>>
>>>
>>> The log4j.properties needs to be in the classpath.
>>>
>>> David
>>>
>>>
>>> On 30/07/2008 17:29, Shinkan wrote:
>>>
>>>> Maybe I should have precised that I run a standalone app .. so no
>>>> application server :]
>>>> Thanks, anyway, that's a pretty hack.
>>>>
>>>> On Wed, Jul 30, 2008 at 17:19, Adam Allgaier
>> <[email protected]> wrote:
>>>>
>>>>
>>>>
>>>>> We created our own servlet to initiate the logger:
>>>>>
>>>>>   <!-- servlet to initialize the logger -->
>>>>>  <servlet>
>>>>>   <servlet-name>log4j-init</servlet-name>
>>>>>   <servlet-class>com.foo.bar.Log4jInit</servlet-class>
>>>>>
>>>>>   <init-param>
>>>>>     <param-name>log4j-init-file</param-name>
>>>>>     <param-value>WEB-INF/logger.conf</param-value>
>>>>>   </init-param>
>>>>>
>>>>>   <load-on-startup>1</load-on-startup>
>>>>>  </servlet>
>>>>>
>>>>>
>>>>> public class Log4jInit extends HttpServlet {
>>>>>
>>>>>  public
>>>>>  void init() {
>>>>>   String prefix =  getServletContext().getRealPath("/");
>>>>>     //set the system property for the logging path
>>>>>
>> System.setProperty("logPath",prefix+"WEB-INF/logs");
>>>>>   String file = getInitParameter("log4j-init-file");
>>>>>   // if the log4j-init-file is not set, then no point in trying
>>>>>   if(file != null) {
>>>>>     PropertyConfigurator.configure(prefix+file);
>>>>>   }
>>>>>  }//init()
>>>>>
>>>>> }//class
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Shinkan <[email protected]>
>>>>> To: Apache Torque Users List <[email protected]>
>>>>> Sent: Wednesday, July 30, 2008 10:07:40 AM
>>>>> Subject: Re: Log4J + Torque ... gonna drive me mad.
>>>>>
>>>>> Thanks for your quick answering !
>>>>>
>>>>> But I tried.
>>>>> With something (kinda, don't remember) like
>>>>> org.apache.log4j.PropertyConfigurator.loadProperties(
>>>>> myPropertiesFilePath
>>>>> );
>>>>> But if failed the same way.
>>>>>
>>>>> And why Torque documentation and defaut Torque.properties file
>> talks
>>>>> about
>>>>> embedding log4j properties on Torque.properties ?
>>>>> Is this just about the convienience of maintaining and loading the
>> same
>>>>> file
>>>>> on 2 properties loaders ?
>>>>>
>>>>> On Wed, Jul 30, 2008 at 17:01, Thomas Fischer
>> <[email protected]>
>>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Torque does not initialize log4j. Initialize log4j yourself
>> and it will
>>>>>> work.
>>>>>>
>>>>>>  Thomas
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi everyone !
>>>>>>>
>>>>>>> I'm trying to make Torque logging working through
>> LOG4J, as it's
>>>>>>>
>>>>>>>
>>>>>> apparently
>>>>>>
>>>>>>
>>>>>>> the only reliable solution (I would have used the native
>> Java Logger
>>>>>>> interface :'( ).
>>>>>>> I've tried many many many Google's answers
>> requesting about "torque
>>>>>>> logging", "torque log4j", "log4j"
>> and more, and I still fail.
>>>>>>>
>>>>>>> I now have this configuration .properties section, which
>> is embedded in
>>>>>>>
>>>>>>>
>>>>>> the
>>>>>>
>>>>>>
>>>>>>> Torque.properties (which is by the way correctly loaded by
>>>>>>>
>>>>>>>
>>>>>> Torque.init(...))
>>>>>>
>>>>>>
>>>>>>> :
>>>>>>>
>>>>>>> log4j.category.default = ALL, default
>>>>>>> log4j.appender.default =
>> org.apache.log4j.RollingFileAppender
>>>>>>> log4j.appender.default.file = log/data.log
>>>>>>> log4j.appender.default.layout =
>> org.apache.log4j.PatternLayout
>>>>>>> log4j.appender.default.layout.conversionPattern = %d [%t]
>> %-5p %c -
>>>>>>>
>>>>>>>
>>>>>> %m%n
>>>>>
>>>>>
>>>>>> log4j.appender.default.maxBackupIndex = 5
>>>>>>> log4j.appender.default.maxFileSize = 5MB
>>>>>>> log4j.appender.default.append = true
>>>>>>>
>>>>>>> Is Torque supposed to init LOG4J at Torque.init( filePath
>> ) phase ?
>>>>>>> How could I proceed ?
>>>>>>> I always get this message at app's startup :
>>>>>>> log4j:WARN No appenders could be found for logger
>>>>>>> (org.apache.torque.TorqueInstance).
>>>>>>> log4j:WARN Please initialize the log4j system properly.
>>>>>>> Thus, I've got absolutely no log ...
>>>>>>>
>>>>>>> Please, help :'(
>>>>>>>
>>>>>>> Many thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Pierre.
>>>>>>> Some people, when confronted with a problem, think "I
>> know, I'll use
>>>>>>>
>>>>>>>
>>>>>> XML".
>>>>>>
>>>>>>
>>>>>>> Now they have two problems. -- Jamie Zawinski / James
>> Robertson
>>>>>>>
>>>>>>>
>>>>>>
>>>>> --
>>>>> Pierre.
>>>>> Some people, when confronted with a problem, think "I know,
>> I'll use
>>>>> XML".
>>>>> Now they have two problems. -- Jamie Zawinski / James Robertson
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>>
>> --
>> Pierre.
>> Some people, when confronted with a problem, think "I know, I'll use
>> XML".
>> Now they have two problems. -- Jamie Zawinski / James Robertson
>>
>>
>>
>
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> [email protected]
> www.forio.com
>



-- 
Forio Business Simulations

Will Glass-Husain
[email protected]
www.forio.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.