You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jacob Kjome <ho...@visi.com> on 2002/06/14 17:25:48 UTC

Re[4]: duplicate debugging output?

Hello Thomas,

No, I'm just confused about it.  So you are saying that I would have
something like:

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true" threshold="debug">
   <appender name="A2" class="org.apache.log4j.FileAppender">
     <param name="File" value="${Barracuda.log.home}/root.log" />
     <param name="Append" value="false" />
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n"/>
     </layout>
   </appender>
   <appender name="A3" class="org.apache.log4j.FileAppender">
     <param name="File" value="${Barracuda.log.home}/main.log" />
     <param name="Append" value="false" />
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n"/>
     </layout>
   </appender>   
   <logger name="org.enhydra.barracuda.core">
     <level value="debug"/>
     <appender-ref ref="A3"/>
   </logger>
   <root>
     <level value="warn"/>
     <appender-ref ref="A2"/>
   </root>
</log4j:configuration>


What If I want to add another logger like:

   <logger name="org.enhydra.barracuda.util">
     <level value="debug"/>
     <appender-ref ref="A3"/>
   </logger>

Are you saying I have to add yet another appender (A4) to deal with
this?

I understand that what I am doing makes no sense to you.  Can you then
provide an example based on what written that does what I need, but is
written like you would write it?  That would be 100 times more helpful
than just telling me that I am confused when I already know and admit
that I'm confused.

Thanks,

Jake

Friday, June 14, 2002, 10:03:07 AM, you wrote:

TTM> Why do you want to have the same appender for root and for
TTM> org.enhydra.barracuda.core? Do you think the duplicates make the log more
TTM> legible?

TTM> Makes no sense to me.

TTM> --

TTM> Thomas






TTM> | -----Original Message-----
TTM> | From: Jacob Kjome [mailto:hoju@visi.com]
TTM> | Sent: 14 June 2002 15:57
TTM> | To: Log4J Users List
TTM> | Subject: Re[2]: duplicate debugging output?
TTM> |
TTM> |
TTM> | Hello Ceki,
TTM> |
TTM> | How is your example different than the one I used?  The only thing you
TTM> | changed was to remove the logger I had defined...which I actually want
TTM> | there because I want to set the level DEBUG on the
TTM> | org.enhydra.barracuda.core package.
TTM> |
TTM> | <logger name="org.enhydra.barracuda.core">
TTM> |                 <level value="debug"/>
TTM> |                 <appender-ref ref="A2"/>
TTM> | </logger>
TTM> |
TTM> | Is Thomas Muller correct in saying that adding additivity="false", as
TTM> | hein Meling has suggested, will not work to get rid of duplicates?
TTM> |
TTM> | What is the standard way to specify that you want, by default, warn
TTM> | level messages to be logged (I assume this is the "root" logger) and
TTM> | add logging for a specific package or class without risking duplicates
TTM> | being printed out?  Can you provide a complete working example that
TTM> | gets rid of duplicates based on the following?...
TTM> |
TTM> | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
TTM> | debug="true" threshold="debug">
TTM> |    <appender name="A2" class="org.apache.log4j.FileAppender">
TTM> |      <param name="File" value="${Barracuda.log.home}/main.log" />
TTM> |      <param name="Append" value="false" />
TTM> |      <layout class="org.apache.log4j.PatternLayout">
TTM> |        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| %x - %m%n"/>>
TTM> |      </layout>
TTM> |    </appender>
TTM> |    <logger name="org.enhydra.barracuda.core">
TTM> |      <level value="debug"/>
TTM> |      <appender-ref ref="A2"/>
TTM> |    </logger>
TTM> |    <root>
TTM> |      <level value="warn"/>
TTM> |      <appender-ref ref="A2"/>
TTM> |    </root>
TTM> | </log4j:configuration>
TTM> |
TTM> |
TTM> | Thanks,
TTM> |
TTM> | Jake
TTM> |
TTM> | Friday, June 14, 2002, 9:08:13 AM, you wrote:
TTM> |
TTM> |
| CG>> But so does:
TTM> |
| CG>>    <logger name="jgroup">
| CG>>      <level value="info"/>
| CG>>      <appender-ref ref="STDOUT-INFO"/>
| CG>>    </logger>
TTM> |
| CG>> Or in Jacob's case:
TTM> |
| CG>> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| CG>> debug="true" threshold="debug">
| CG>>    <appender name="A2" class="org.apache.log4j.FileAppender">
| CG>>      <param name="File" value="${Barracuda.log.home}/main.log" />
| CG>>      <param name="Append" value="false" />
| CG>>      <layout class="org.apache.log4j.PatternLayout">
| CG>>        <param name="ConversionPattern" value="%-4r [%t] %-5p
| %c %x - %m%n"/>>
| CG>>      </layout>
| CG>>    </appender>
| CG>>    <root>
| CG>>      <level value="warn"/>
| CG>>      <appender-ref ref="A2"/>
| CG>>    </root>
| CG>> </log4j:configuration>
TTM> |
TTM> |
| CG>> At 15:38 14.06.2002 +0200, you wrote:
| >>>Jacob Kjome wrote:
| >>> > It is very likely that the duplicates are entirely my fault,
TTM> | but I can't
| >>> > see how.  Can someone point it out to me?
| >>>
| >>>Try setting the additivity flag to false; like this:
| >>>
| >>>   <logger name="jgroup">
| >>>     <level value="info"/>
| >>>     <appender-ref ref="STDOUT-INFO"/>
| >>>   </logger>
| >>>
| >>>   <logger name="jgroup.arm.ExecDaemon" additivity="false">
| >>>     <level value="debug"/>
| >>>     <appender-ref ref="STDOUT"/>
| >>>   </logger>
| >>>
| >>>If I recall correctly, this prevents duplicate log events from
| >>>jgroup.arm.ExecDaemon.
| >>>
| >>>Ciao,
| >>>   Hein
| >>>
| >>>--
| >>>To unsubscribe, e-mail:
TTM> | <ma...@jakarta.apache.org>
| >>>For additional commands, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> |
| CG>> --
| CG>> Ceki
TTM> |
| CG>> SUICIDE BOMBING - A CRIME AGAINST HUMANITY
| CG>> Sign the petition: http://www.petitiononline.com/1234567b
| CG>> I am signatory number 22106. What is your number?
TTM> |
TTM> |
| CG>> --
| CG>> To unsubscribe, e-mail:
TTM> | <ma...@jakarta.apache.org>
| CG>> For additional commands, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> |
TTM> |
TTM> |
TTM> | --
TTM> | Best regards,
TTM> |  Jacob                            mailto:hoju@visi.com
TTM> |
TTM> |
TTM> | --
TTM> | To unsubscribe, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> | For additional commands, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> |
TTM> |



TTM> *************************************************************************
TTM> Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
TTM> The information supplied in this email should be treated in confidence.
TTM> No liability whatsoever is accepted for any loss or damage 
TTM> suffered as a result of accessing this message or any attachments.

TTM> ________________________________________________________________________
TTM> This email has been scanned for all viruses by the MessageLabs SkyScan
TTM> service. For more information on a proactive anti-virus service working
TTM> around the clock, around the globe, visit http://www.messagelabs.com
TTM> ________________________________________________________________________

TTM> --
TTM> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
TTM> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Re[6]: duplicate debugging output?

Posted by Thomas Tuft Muller <tt...@online.no>.
| Heh, the "tough love" approach, eh? Give 'em a fish and they'll eat
| today, teach them to fish and they'll eat for a lifetime?

If you say so.

| Well, you're right.  I should have looked more closely at the manual
| and am reading now.

I'm not protesting. A lot of people on this list are happy to reply to your
questions and help you (I know, because many clever people have helped me
with my problems), especially if you show that you've exhausted other
sources of information, especially the manual, the javadoc and the
sourcecode. By not bothering to even glimpse at the manual, you show
disrespect to those people who make an effort to give you a helping hand.

| I assume that with the different appenders, if they are File
| appenders, I would require different files for each appender to log
| to, right?

Yes.

| Otherwise, I'd run into the same duplicate logging if I
| pointed it all to a single file...

Again, you will only see dublicate log entries if a Logger shares appender
with one of its ancestors - which again does not make sense; log events
emitted from the descendant is supposed to go the ancestor's appender(s)
anyway, that's the whole point.

| not to mention the fact that I'd
| run into race conditions with two different appenders attempting to
| open and write to the file at the same time.  Am I correct here?

The JavaDoc for FileAppender.setFile() reads: 'If there was already an
opened file, then the previous file is closed first.' The appender itself
will handle the race conditions (writing to the appender is synchronized),
but it still doesn't make sense to have multiple FileAppenders sharing a
file - the reasons are obvious.

Hope this helps,

--

Thomas


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[6]: duplicate debugging output?

Posted by Jacob Kjome <ho...@visi.com>.
Hello Thomas,

Heh, the "tough love" approach, eh? Give 'em a fish and they'll eat
today, teach them to fish and they'll eat for a lifetime?

Well, you're right.  I should have looked more closely at the manual
and am reading now.

I assume that with the different appenders, if they are File
appenders, I would require different files for each appender to log
to, right?  Otherwise, I'd run into the same duplicate logging if I
pointed it all to a single file... not to mention the fact that I'd
run into race conditions with two different appenders attempting to
open and write to the file at the same time.  Am I correct here?

thanks,

Jake

Friday, June 14, 2002, 10:47:27 AM, you wrote:

TTM> Jacob,

TTM> It's always a good idea to peruse the manual. Especially, pay attention to
TTM> the explanation of Logger ancestors/descendants and appender additivity.

TTM> If you have an appender defined for Logger 'a', and another for Logger
TTM> 'a.x', all log entries sent to the 'a.x' category will be sent to the
TTM> appender for 'a' _as well_ as the appender defined for the root category.
TTM> Please see the Appenders and Layouts section in the manual.

TTM> In your application I'd have an appender called ROOT for the root cateogry.
TTM> Period. _Never_ confuse or mix the root appender with other appenders,
TTM> unless you want confusing duplicates.

TTM> Then you could e.g. have an appender for the Logger 'org.enhydra.barracuda',
TTM> and two (distinctive) others for 'org.enhydra.barracuda.core' and for
TTM> org.enhydra.barracuda.util'. Unless you set the additivity flag to false for
TTM> the latter, all log entries sent to those Loggers, will be duplicated in the
TTM> appender(s) for org.enhydra.barracuda in addition (of course) to the root
TTM> appender.

TTM> Again, the manual and the Javadoc are your best source for help.

TTM> --

TTM> Thomas




TTM> | -----Original Message-----
TTM> | From: Jacob Kjome [mailto:hoju@visi.com]
TTM> | Sent: 14 June 2002 16:26
TTM> | To: Log4J Users List; ttm@online.no
TTM> | Subject: Re[4]: duplicate debugging output?
TTM> |
TTM> |
TTM> | Hello Thomas,
TTM> |
TTM> | No, I'm just confused about it.  So you are saying that I would have
TTM> | something like:
TTM> |
TTM> | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
TTM> | debug="true" threshold="debug">
TTM> |    <appender name="A2" class="org.apache.log4j.FileAppender">
TTM> |      <param name="File" value="${Barracuda.log.home}/root.log" />
TTM> |      <param name="Append" value="false" />
TTM> |      <layout class="org.apache.log4j.PatternLayout">
TTM> |        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| %x - %m%n"/>>
TTM> |      </layout>
TTM> |    </appender>
TTM> |    <appender name="A3" class="org.apache.log4j.FileAppender">
TTM> |      <param name="File" value="${Barracuda.log.home}/main.log" />
TTM> |      <param name="Append" value="false" />
TTM> |      <layout class="org.apache.log4j.PatternLayout">
TTM> |        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| %x - %m%n"/>>
TTM> |      </layout>
TTM> |    </appender>
TTM> |    <logger name="org.enhydra.barracuda.core">
TTM> |      <level value="debug"/>
TTM> |      <appender-ref ref="A3"/>
TTM> |    </logger>
TTM> |    <root>
TTM> |      <level value="warn"/>
TTM> |      <appender-ref ref="A2"/>
TTM> |    </root>
TTM> | </log4j:configuration>
TTM> |
TTM> |
TTM> | What If I want to add another logger like:
TTM> |
TTM> |    <logger name="org.enhydra.barracuda.util">
TTM> |      <level value="debug"/>
TTM> |      <appender-ref ref="A3"/>
TTM> |    </logger>
TTM> |
TTM> | Are you saying I have to add yet another appender (A4) to deal with
TTM> | this?
TTM> |
TTM> | I understand that what I am doing makes no sense to you.  Can you then
TTM> | provide an example based on what written that does what I need, but is
TTM> | written like you would write it?  That would be 100 times more helpful
TTM> | than just telling me that I am confused when I already know and admit
TTM> | that I'm confused.
TTM> |
TTM> | Thanks,
TTM> |
TTM> | Jake
TTM> |
TTM> | Friday, June 14, 2002, 10:03:07 AM, you wrote:
TTM> |
| TTM>> Why do you want to have the same appender for root and for
| TTM>> org.enhydra.barracuda.core? Do you think the duplicates make
TTM> | the log more
| TTM>> legible?
TTM> |
| TTM>> Makes no sense to me.
TTM> |
| TTM>> --
TTM> |
| TTM>> Thomas
TTM> |
TTM> |
TTM> |
TTM> |
TTM> |
TTM> |
| TTM>> | -----Original Message-----
| TTM>> | From: Jacob Kjome [mailto:hoju@visi.com]
| TTM>> | Sent: 14 June 2002 15:57
| TTM>> | To: Log4J Users List
| TTM>> | Subject: Re[2]: duplicate debugging output?
| TTM>> |
| TTM>> |
| TTM>> | Hello Ceki,
| TTM>> |
| TTM>> | How is your example different than the one I used?  The
TTM> | only thing you
| TTM>> | changed was to remove the logger I had defined...which I
TTM> | actually want
| TTM>> | there because I want to set the level DEBUG on the
| TTM>> | org.enhydra.barracuda.core package.
| TTM>> |
| TTM>> | <logger name="org.enhydra.barracuda.core">
| TTM>> |                 <level value="debug"/>
| TTM>> |                 <appender-ref ref="A2"/>
| TTM>> | </logger>
| TTM>> |
| TTM>> | Is Thomas Muller correct in saying that adding
TTM> | additivity="false", as
| TTM>> | hein Meling has suggested, will not work to get rid of duplicates?
| TTM>> |
| TTM>> | What is the standard way to specify that you want, by default, warn
| TTM>> | level messages to be logged (I assume this is the "root"
TTM> | logger) and
| TTM>> | add logging for a specific package or class without
TTM> | risking duplicates
| TTM>> | being printed out?  Can you provide a complete working example that
| TTM>> | gets rid of duplicates based on the following?...
| TTM>> |
| TTM>> | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| TTM>> | debug="true" threshold="debug">
| TTM>> |    <appender name="A2" class="org.apache.log4j.FileAppender">
| TTM>> |      <param name="File" value="${Barracuda.log.home}/main.log" />
| TTM>> |      <param name="Append" value="false" />
| TTM>> |      <layout class="org.apache.log4j.PatternLayout">
| TTM>> |        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| | %x - %m%n"/>>>
| TTM>> |      </layout>
| TTM>> |    </appender>
| TTM>> |    <logger name="org.enhydra.barracuda.core">
| TTM>> |      <level value="debug"/>
| TTM>> |      <appender-ref ref="A2"/>
| TTM>> |    </logger>
| TTM>> |    <root>
| TTM>> |      <level value="warn"/>
| TTM>> |      <appender-ref ref="A2"/>
| TTM>> |    </root>
| TTM>> | </log4j:configuration>
| TTM>> |
| TTM>> |
| TTM>> | Thanks,
| TTM>> |
| TTM>> | Jake
| TTM>> |
| TTM>> | Friday, June 14, 2002, 9:08:13 AM, you wrote:
| TTM>> |
| TTM>> |
| | CG>>> But so does:
| TTM>> |
| | CG>>>    <logger name="jgroup">
| | CG>>>      <level value="info"/>
| | CG>>>      <appender-ref ref="STDOUT-INFO"/>
| | CG>>>    </logger>
| TTM>> |
| | CG>>> Or in Jacob's case:
| TTM>> |
| | CG>>> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| | CG>>> debug="true" threshold="debug">
| | CG>>>    <appender name="A2" class="org.apache.log4j.FileAppender">
| | CG>>>      <param name="File" value="${Barracuda.log.home}/main.log" />
| | CG>>>      <param name="Append" value="false" />
| | CG>>>      <layout class="org.apache.log4j.PatternLayout">
| | CG>>>        <param name="ConversionPattern" value="%-4r [%t] %-5p
| | %c %x - %m%n"/>>>
| | CG>>>      </layout>
| | CG>>>    </appender>
| | CG>>>    <root>
| | CG>>>      <level value="warn"/>
| | CG>>>      <appender-ref ref="A2"/>
| | CG>>>    </root>
| | CG>>> </log4j:configuration>
| TTM>> |
| TTM>> |
| | CG>>> At 15:38 14.06.2002 +0200, you wrote:
| | >>>>Jacob Kjome wrote:
| | >>>> > It is very likely that the duplicates are entirely my fault,
| TTM>> | but I can't
| | >>>> > see how.  Can someone point it out to me?
| | >>>>
| | >>>>Try setting the additivity flag to false; like this:
| | >>>>
| | >>>>   <logger name="jgroup">
| | >>>>     <level value="info"/>
| | >>>>     <appender-ref ref="STDOUT-INFO"/>
| | >>>>   </logger>
| | >>>>
| | >>>>   <logger name="jgroup.arm.ExecDaemon" additivity="false">
| | >>>>     <level value="debug"/>
| | >>>>     <appender-ref ref="STDOUT"/>
| | >>>>   </logger>
| | >>>>
| | >>>>If I recall correctly, this prevents duplicate log events from
| | >>>>jgroup.arm.ExecDaemon.
| | >>>>
| | >>>>Ciao,
| | >>>>   Hein
| | >>>>
| | >>>>--
| | >>>>To unsubscribe, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| | >>>>For additional commands, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| TTM>> |
| | CG>>> --
| | CG>>> Ceki
| TTM>> |
| | CG>>> SUICIDE BOMBING - A CRIME AGAINST HUMANITY
| | CG>>> Sign the petition: http://www.petitiononline.com/1234567b
| | CG>>> I am signatory number 22106. What is your number?
| TTM>> |
| TTM>> |
| | CG>>> --
| | CG>>> To unsubscribe, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| | CG>>> For additional commands, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| TTM>> |
| TTM>> |
| TTM>> |
| TTM>> | --
| TTM>> | Best regards,
| TTM>> |  Jacob                            mailto:hoju@visi.com
| TTM>> |
| TTM>> |
| TTM>> | --
| TTM>> | To unsubscribe, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| TTM>> | For additional commands, e-mail:
| TTM>> | <ma...@jakarta.apache.org>
| TTM>> |
| TTM>> |
TTM> |
TTM> |
TTM> |
| TTM>>
TTM> | *************************************************************************
| TTM>> Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All
TTM> | rights reserved.
| TTM>> The information supplied in this email should be treated in
TTM> | confidence.
| TTM>> No liability whatsoever is accepted for any loss or damage
| TTM>> suffered as a result of accessing this message or any attachments.
TTM> |
| TTM>>
TTM> | ________________________________________________________________________
| TTM>> This email has been scanned for all viruses by the
TTM> | MessageLabs SkyScan
| TTM>> service. For more information on a proactive anti-virus
TTM> | service working
| TTM>> around the clock, around the globe, visit http://www.messagelabs.com
| TTM>>
TTM> | ________________________________________________________________________
TTM> |
| TTM>> --
| TTM>> To unsubscribe, e-mail:
TTM> | <ma...@jakarta.apache.org>
| TTM>> For additional commands, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> |
TTM> |
TTM> |
TTM> | --
TTM> | Best regards,
TTM> |  Jacob                            mailto:hoju@visi.com
TTM> |
TTM> |
TTM> | --
TTM> | To unsubscribe, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> | For additional commands, e-mail:
TTM> | <ma...@jakarta.apache.org>
TTM> |
TTM> |



TTM> *************************************************************************
TTM> Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
TTM> The information supplied in this email should be treated in confidence.
TTM> No liability whatsoever is accepted for any loss or damage 
TTM> suffered as a result of accessing this message or any attachments.

TTM> ________________________________________________________________________
TTM> This email has been scanned for all viruses by the MessageLabs SkyScan
TTM> service. For more information on a proactive anti-virus service working
TTM> around the clock, around the globe, visit http://www.messagelabs.com
TTM> ________________________________________________________________________

TTM> --
TTM> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
TTM> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Re[4]: duplicate debugging output?

Posted by Thomas Tuft Muller <tt...@online.no>.
Jacob,

It's always a good idea to peruse the manual. Especially, pay attention to
the explanation of Logger ancestors/descendants and appender additivity.

If you have an appender defined for Logger 'a', and another for Logger
'a.x', all log entries sent to the 'a.x' category will be sent to the
appender for 'a' _as well_ as the appender defined for the root category.
Please see the Appenders and Layouts section in the manual.

In your application I'd have an appender called ROOT for the root cateogry.
Period. _Never_ confuse or mix the root appender with other appenders,
unless you want confusing duplicates.

Then you could e.g. have an appender for the Logger 'org.enhydra.barracuda',
and two (distinctive) others for 'org.enhydra.barracuda.core' and for
org.enhydra.barracuda.util'. Unless you set the additivity flag to false for
the latter, all log entries sent to those Loggers, will be duplicated in the
appender(s) for org.enhydra.barracuda in addition (of course) to the root
appender.

Again, the manual and the Javadoc are your best source for help.

--

Thomas




| -----Original Message-----
| From: Jacob Kjome [mailto:hoju@visi.com]
| Sent: 14 June 2002 16:26
| To: Log4J Users List; ttm@online.no
| Subject: Re[4]: duplicate debugging output?
|
|
| Hello Thomas,
|
| No, I'm just confused about it.  So you are saying that I would have
| something like:
|
| <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| debug="true" threshold="debug">
|    <appender name="A2" class="org.apache.log4j.FileAppender">
|      <param name="File" value="${Barracuda.log.home}/root.log" />
|      <param name="Append" value="false" />
|      <layout class="org.apache.log4j.PatternLayout">
|        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| %x - %m%n"/>
|      </layout>
|    </appender>
|    <appender name="A3" class="org.apache.log4j.FileAppender">
|      <param name="File" value="${Barracuda.log.home}/main.log" />
|      <param name="Append" value="false" />
|      <layout class="org.apache.log4j.PatternLayout">
|        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| %x - %m%n"/>
|      </layout>
|    </appender>
|    <logger name="org.enhydra.barracuda.core">
|      <level value="debug"/>
|      <appender-ref ref="A3"/>
|    </logger>
|    <root>
|      <level value="warn"/>
|      <appender-ref ref="A2"/>
|    </root>
| </log4j:configuration>
|
|
| What If I want to add another logger like:
|
|    <logger name="org.enhydra.barracuda.util">
|      <level value="debug"/>
|      <appender-ref ref="A3"/>
|    </logger>
|
| Are you saying I have to add yet another appender (A4) to deal with
| this?
|
| I understand that what I am doing makes no sense to you.  Can you then
| provide an example based on what written that does what I need, but is
| written like you would write it?  That would be 100 times more helpful
| than just telling me that I am confused when I already know and admit
| that I'm confused.
|
| Thanks,
|
| Jake
|
| Friday, June 14, 2002, 10:03:07 AM, you wrote:
|
| TTM> Why do you want to have the same appender for root and for
| TTM> org.enhydra.barracuda.core? Do you think the duplicates make
| the log more
| TTM> legible?
|
| TTM> Makes no sense to me.
|
| TTM> --
|
| TTM> Thomas
|
|
|
|
|
|
| TTM> | -----Original Message-----
| TTM> | From: Jacob Kjome [mailto:hoju@visi.com]
| TTM> | Sent: 14 June 2002 15:57
| TTM> | To: Log4J Users List
| TTM> | Subject: Re[2]: duplicate debugging output?
| TTM> |
| TTM> |
| TTM> | Hello Ceki,
| TTM> |
| TTM> | How is your example different than the one I used?  The
| only thing you
| TTM> | changed was to remove the logger I had defined...which I
| actually want
| TTM> | there because I want to set the level DEBUG on the
| TTM> | org.enhydra.barracuda.core package.
| TTM> |
| TTM> | <logger name="org.enhydra.barracuda.core">
| TTM> |                 <level value="debug"/>
| TTM> |                 <appender-ref ref="A2"/>
| TTM> | </logger>
| TTM> |
| TTM> | Is Thomas Muller correct in saying that adding
| additivity="false", as
| TTM> | hein Meling has suggested, will not work to get rid of duplicates?
| TTM> |
| TTM> | What is the standard way to specify that you want, by default, warn
| TTM> | level messages to be logged (I assume this is the "root"
| logger) and
| TTM> | add logging for a specific package or class without
| risking duplicates
| TTM> | being printed out?  Can you provide a complete working example that
| TTM> | gets rid of duplicates based on the following?...
| TTM> |
| TTM> | <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| TTM> | debug="true" threshold="debug">
| TTM> |    <appender name="A2" class="org.apache.log4j.FileAppender">
| TTM> |      <param name="File" value="${Barracuda.log.home}/main.log" />
| TTM> |      <param name="Append" value="false" />
| TTM> |      <layout class="org.apache.log4j.PatternLayout">
| TTM> |        <param name="ConversionPattern" value="%-4r [%t] %-5p %c
| | %x - %m%n"/>>
| TTM> |      </layout>
| TTM> |    </appender>
| TTM> |    <logger name="org.enhydra.barracuda.core">
| TTM> |      <level value="debug"/>
| TTM> |      <appender-ref ref="A2"/>
| TTM> |    </logger>
| TTM> |    <root>
| TTM> |      <level value="warn"/>
| TTM> |      <appender-ref ref="A2"/>
| TTM> |    </root>
| TTM> | </log4j:configuration>
| TTM> |
| TTM> |
| TTM> | Thanks,
| TTM> |
| TTM> | Jake
| TTM> |
| TTM> | Friday, June 14, 2002, 9:08:13 AM, you wrote:
| TTM> |
| TTM> |
| | CG>> But so does:
| TTM> |
| | CG>>    <logger name="jgroup">
| | CG>>      <level value="info"/>
| | CG>>      <appender-ref ref="STDOUT-INFO"/>
| | CG>>    </logger>
| TTM> |
| | CG>> Or in Jacob's case:
| TTM> |
| | CG>> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
| | CG>> debug="true" threshold="debug">
| | CG>>    <appender name="A2" class="org.apache.log4j.FileAppender">
| | CG>>      <param name="File" value="${Barracuda.log.home}/main.log" />
| | CG>>      <param name="Append" value="false" />
| | CG>>      <layout class="org.apache.log4j.PatternLayout">
| | CG>>        <param name="ConversionPattern" value="%-4r [%t] %-5p
| | %c %x - %m%n"/>>
| | CG>>      </layout>
| | CG>>    </appender>
| | CG>>    <root>
| | CG>>      <level value="warn"/>
| | CG>>      <appender-ref ref="A2"/>
| | CG>>    </root>
| | CG>> </log4j:configuration>
| TTM> |
| TTM> |
| | CG>> At 15:38 14.06.2002 +0200, you wrote:
| | >>>Jacob Kjome wrote:
| | >>> > It is very likely that the duplicates are entirely my fault,
| TTM> | but I can't
| | >>> > see how.  Can someone point it out to me?
| | >>>
| | >>>Try setting the additivity flag to false; like this:
| | >>>
| | >>>   <logger name="jgroup">
| | >>>     <level value="info"/>
| | >>>     <appender-ref ref="STDOUT-INFO"/>
| | >>>   </logger>
| | >>>
| | >>>   <logger name="jgroup.arm.ExecDaemon" additivity="false">
| | >>>     <level value="debug"/>
| | >>>     <appender-ref ref="STDOUT"/>
| | >>>   </logger>
| | >>>
| | >>>If I recall correctly, this prevents duplicate log events from
| | >>>jgroup.arm.ExecDaemon.
| | >>>
| | >>>Ciao,
| | >>>   Hein
| | >>>
| | >>>--
| | >>>To unsubscribe, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| | >>>For additional commands, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| TTM> |
| | CG>> --
| | CG>> Ceki
| TTM> |
| | CG>> SUICIDE BOMBING - A CRIME AGAINST HUMANITY
| | CG>> Sign the petition: http://www.petitiononline.com/1234567b
| | CG>> I am signatory number 22106. What is your number?
| TTM> |
| TTM> |
| | CG>> --
| | CG>> To unsubscribe, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| | CG>> For additional commands, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| TTM> |
| TTM> |
| TTM> |
| TTM> | --
| TTM> | Best regards,
| TTM> |  Jacob                            mailto:hoju@visi.com
| TTM> |
| TTM> |
| TTM> | --
| TTM> | To unsubscribe, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| TTM> | For additional commands, e-mail:
| TTM> | <ma...@jakarta.apache.org>
| TTM> |
| TTM> |
|
|
|
| TTM>
| *************************************************************************
| TTM> Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All
| rights reserved.
| TTM> The information supplied in this email should be treated in
| confidence.
| TTM> No liability whatsoever is accepted for any loss or damage
| TTM> suffered as a result of accessing this message or any attachments.
|
| TTM>
| ________________________________________________________________________
| TTM> This email has been scanned for all viruses by the
| MessageLabs SkyScan
| TTM> service. For more information on a proactive anti-virus
| service working
| TTM> around the clock, around the globe, visit http://www.messagelabs.com
| TTM>
| ________________________________________________________________________
|
| TTM> --
| TTM> To unsubscribe, e-mail:
| <ma...@jakarta.apache.org>
| TTM> For additional commands, e-mail:
| <ma...@jakarta.apache.org>
|
|
|
| --
| Best regards,
|  Jacob                            mailto:hoju@visi.com
|
|
| --
| To unsubscribe, e-mail:
| <ma...@jakarta.apache.org>
| For additional commands, e-mail:
| <ma...@jakarta.apache.org>
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
The information supplied in this email should be treated in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>