The approach I did is documented (perhaps poorly) at 
http://logging.apache.org/log4j/2.x/manual/configuration.html in the section 
titled configuring filters.  Adding the level to the appender-ref may not be 
documented. That was missed when the feature was added.

Ralph

On Apr 23, 2013, at 5:50 PM, Remko Popma wrote:

> I see. I understood Peter's question differently. Let's hope one of our 
> answers solves his problem! :-)
> 
> Sent from my iPhone
> 
> On 2013/04/24, at 9:46, Ralph Goers <ralph.go...@dslextreme.com> wrote:
> 
>> Your trace file will also contain info and above. From Peter's question I 
>> understood him to mean he only wants events at that level.  We don't have a 
>> filter that does that specifically so I used two threshold filters to do it.
>> 
>> Ralph
>> 
>> On Apr 23, 2013, at 5:42 PM, Remko Popma wrote:
>> 
>>> I don't think the docs have an example yet. This one worked for me:
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <configuration status="WARN">
>>> <appenders>
>>>  <File name="InfoFile" fileName="level-info.log">
>>>    <PatternLayout>
>>>      <pattern>%d %-5p %c{1.} [%t] %m %ex%n</pattern>
>>>    </PatternLayout>
>>>  </File>
>>>  <File name="TraceFile" fileName="level-trace.log">
>>>    <PatternLayout>
>>>      <pattern>%d %-5p %c{1.} [%t] %m %ex%n</pattern>
>>>    </PatternLayout>
>>>  </File>
>>> </appenders>
>>> <loggers>
>>>  <root level="trace">
>>>    <appender-ref ref="InfoFile" level="info" />
>>>    <appender-ref ref="TraceFile"/>
>>>  </root>
>>> </loggers>
>>> </configuration>
>>> 
>>> 
>>> Sent from my iPhone
>>> 
>>> On 2013/04/24, at 9:22, Peter DePasquale <peter.depasqu...@gmail.com> wrote:
>>> 
>>>> Can you point me to an example in the documentation?  I didn't see anything
>>>> like that in there, that I recall...
>>>> 
>>>> 
>>>> On Tue, Apr 23, 2013 at 6:28 PM, Ralph Goers 
>>>> <ralph.go...@dslextreme.com>wrote:
>>>> 
>>>>> You cannot have two root loggers but you can have multiple appender-refs
>>>>> on them.  Each appender-ref can have its own log level so I believe you 
>>>>> get
>>>>> the same behavior that you are looking for.
>>>>> 
>>>>> Ralph
>>>>> 
>>>>> On Apr 23, 2013, at 12:37 PM, Peter DePasquale wrote:
>>>>> 
>>>>>> Is it possible to use two root loggers, one to capture trace and one to
>>>>>> capture errors (or more generally, two different levels)? If so, can
>>>>>> someone please provide a simple config example? Thanks.
>>>>>> 
>>>>>> --
>>>>>> Peter J. DePasquale, Ph.D.
>>>>>> Department of Computer Science
>>>>>> The College of New Jersey
>>>>>> (e) depasqua [at] tcnj [dot] edu
>>>>>> (p) 609-771-2806
>>>>>> (f) 609-637-5190
>>>>>> (o) Holman Hall - Room 238
>>>>>> (l) Holman Hall - Room 255
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>>>>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>>> 
>>>> 
>>>> -- 
>>>> Peter J. DePasquale, Ph.D.
>>>> Department of Computer Science
>>>> The College of New Jersey
>>>> (e) depasqua [at] tcnj [dot] edu
>>>> (p) 609-771-2806
>>>> (f) 609-637-5190
>>>> (o) Holman Hall - Room 238
>>>> (l) Holman Hall - Room 255
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 

Reply via email to