cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilbertoca <gilbert...@gmail.com>
Subject RE: Cannot correctly configure log4j to log Cayenne stuff
Date Thu, 14 Jun 2012 21:23:46 GMT
My log4j.xml[1] file:

gilberto.andrade@SUGEP265338:~/dev/netbeans-config/trunk/park-samples/park-cayenne$
cat src/main/resources/log4j.xml


> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE log4j:configuration SYSTEM &quot;log4j.dtd&quot;>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
>   <appender name="A1" class="org.apache.log4j.ConsoleAppender">
>     <layout class="org.apache.log4j.PatternLayout">
>       
>     </layout>
>   </appender>
>   <logger name="org.apache.cayenne">
>     <level value="ERROR"/>
>   </logger>  
>   <logger name="park.model">
>     <level value="DEBUG"/>
>   </logger>
>   <logger name="org.dbunit">
>     <level value="INFO"/>
>   </logger>
>   <root>
>     <priority value ="warn" />
>     <appender-ref ref="A1" />
>   </root>
> </log4j:configuration>
> 

What has happened to me is that sometimes I forgot to setup the log4j for
run-time - just to test. In this case (when I forget ...), there is no log
output.

gilberto.andrade@SUGEP265338:~/dev/netbeans-config/trunk/park-samples/park-cayenne$
ll target/classes/
total 44
drwxr-xr-x 3 gilberto.andrade users  4096 Jun 14 18:09 ./
drwxr-xr-x 5 gilberto.andrade users  4096 Jun 14 18:09 ../
-rw-r--r-- 1 gilberto.andrade users   579 Jun 14 18:09
cayenne-ParkDomain.xml
-rw-r--r-- 1 gilberto.andrade users   685 Jun 14 18:09 click-page.properties
-rw-r--r-- 1 gilberto.andrade users   733 Jun 14 18:09
click-page_pt_BR.properties
-rw-r--r-- 1 gilberto.andrade users 15568 Jun 14 18:09 DataMap.map.xml
-rw-r--r-- 1 gilberto.andrade users  1002 Jun 14 18:09 log4j.xml
drwxr-xr-x 4 gilberto.andrade users  4096 Jun 14 18:09 park/

Regards,

Gilberto
[1]
https://code.google.com/p/construtor/source/browse/trunk/park-samples/park-cayenne/src/main/resources/log4j.xml?spec=svn1038&r=1038



cghersi wrote
> 
> Emerson, I tried your approach but it didn’t worked for me. L
> 
>  
> 
> Any other idea?
> 
>  
> 
> Thank you very much.
> 
> Best
> 
> cghersi
> 
>  
> 
> From: Emerson Castañeda [via Cayenne]
> [mailto:ml-node+s195n4024283h5@.nabble] 
> Sent: giovedì 14 giugno 2012 12:32
> To: cghersi
> Subject: Re: Cannot correctly configure log4j to log Cayenne stuff
> 
>  
> 
> My log4j.properties is at same place that cayenne.xml file, in my specific 
> case at root folder: src directory. 
> 
> Hope this works for you!! 
> 
> 
> 
> On Thu, Jun 14, 2012 at 12:23 PM, cghersi <[hidden email]>wrote: 
> 
> 
>> Hi Emerson, thank you for the fast response! 
>> 
>> 
>> 
>> Where did you put your log4j.properties? Have you added anything of
>> cayenne 
>> configuration? 
>> 
>> 
>> 
>> Thanks! 
>> 
>> Best 
>> 
>> cghersi 
>> 
>> 
>> 
>> From: Emerson Castañeda [via Cayenne] 
>> [mailto:[hidden email]] 
>> Sent: giovedì 14 giugno 2012 12:14 
>> To: cghersi 
>> Subject: Re: Cannot correctly configure log4j to log Cayenne stuff 
>> 
>> 
>> 
>> Hi 
>> 
>> The way I got to stop too much level of info log by Cayenne, but keeping
>> a 
>> more detail level to other stuff,  using this parameter into my 
>> configuration: 
>> 
>> *log4j.logger.org.apache.cayenne=ERROR* 
>> 
>> Sample of my log4j.properties: 
>> 
>> *# Root logger option* 
>> *log4j.rootLogger=DEBUG, file, stdout* 
>> *log4j.logger.org.apache.commons.httpclient=ERROR* 
>> *log4j.additivity.org.apache.commons.httpclient=false* 
>> *log4j.logger.org.apache.cayenne=ERROR* 
>> *#log4j.additivity.org.apache.cayenne=false* 
>> *log4j.logger.org.cyberneko.html=ERROR* 
>> *log4j.additivity.org.cyberneko.html=false* 
>> *log4j.logger.org.apache.velocity=ERROR* 
>> *log4j.additivity.org.apache.velocity=false* 
>> *log4j.logger.org.dom4j=ERROR* 
>> 
>> Best Regards 
>> 
>> EMERSON 
>> 
>> 
>> On Thu, Jun 14, 2012 at 11:51 AM, cghersi <[hidden email]>wrote: 
>> 
>> 
>> > Hi all, 
>> > 
>> > I started using Cayenne two years ago, and I've never understand how to 
>> > correctly configure logging feature. 
>> > I'm using Cayenne 3.0 under OSGi environment, and I also use log4j in
>> my 
>> > environment. 
>> > In my log4j.xml XML configuration file I added this entry: 
>> >        <logger name="org.apache.cayenne.access.QueryLogger" 
>> > additivity="false"> 
>> >                <level value="error"/> 
>> >                <appender-ref ref="File" /> 
>> >                <appender-ref ref="console" /> 
>> >        </logger> 
>> > 
>> > but nevertheless I can see a huge amount of logs from QueryLogger
>> class. 
>> > I tried to put this file everywhere in my PC, but same results
>> everytime! 
>> > :( 
>> > 
>> > Is there any configuration I need to add during the configuration of 
>> > Cayenne? 
>> > 
>> > Thank you very much! 
>> > Best 
>> > cghersi 
>> > 
>> > -- 
>> > View this message in context: 
>> > 
>> 
>> http://cayenne.195.n3.nabble.com/Cannot-correctly-configure-log4j-to-log-Cay
>> enne-stuff-tp4024280.html 
>> > Sent from the Cayenne - User mailing list archive at Nabble.com. 
>> > 
>> 
>> 
>> 
>>   _____ 
>> 
>> If you reply to this email, your message will be added to the discussion 
>> below: 
>> 
>> 
>> http://cayenne.195.n3.nabble.com/Cannot-correctly-configure-log4j-to-log-Cay
>> enne-stuff-tp4024280p4024281.html 
>> 
>> To unsubscribe from Cannot correctly configure log4j to log Cayenne
>> stuff, 
>> click here 
>> < 
>> http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe
>> 
>> _by_code&node=4024280&code=Y3Jpc3RpYW5vLmdoZXJzaUBhYm9kYXRhLmNvbXw0MDI0Mjgwf

>> DUzMzUzMjY3> . 
>> 
>> < 
>> http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewe
>> 
>> r&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNam

>> 
>> espace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.Nod 
>> 
>> eNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emai

>> ls%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML 
>> 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://cayenne.195.n3.nabble.com/Cannot-correctly-configure-log4j-to-log-Cayenne-stuff-tp4024280p4024282.html
>> Sent from the Cayenne - User mailing list archive at Nabble.com. 
>> 
> 
>  
> 
>   _____  
> 
> If you reply to this email, your message will be added to the discussion
> below:
> 
> http://cayenne.195.n3.nabble.com/Cannot-correctly-configure-log4j-to-log-Cayenne-stuff-tp4024280p4024283.html

> 
> To unsubscribe from Cannot correctly configure log4j to log Cayenne stuff,
> click here
> &lt;http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=4024280&amp;code=Y3Jpc3RpYW5vLmdoZXJzaUBhYm9kYXRhLmNvbXw0MDI0MjgwfDUzMzUzMjY3&gt;
> .
> 
> &lt;http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml&gt;
> NAML
> 

--
View this message in context: http://cayenne.195.n3.nabble.com/Cannot-correctly-configure-log4j-to-log-Cayenne-stuff-tp4024280p4024305.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Mime
View raw message