You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2016/02/14 00:54:06 UTC

Unit test question

Hi All:

Any hints on how to hook up a new logger to work like a TestLogger in:

org.apache.logging.log4j.LoggerTest.flowTracingString_ObjectArray2_ParameterizedMessageFactory()

?

Thank you,
Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Unit test question

Posted by Matt Sicker <bo...@gmail.com>.
Oh ok. :)

On 13 February 2016 at 21:47, Gary Gregory <ga...@gmail.com> wrote:

> I made a silly mistake in the original version of the test. Fixed now.
> Thanks Matt!
>
> Gary
> On Feb 13, 2016 7:42 PM, "Matt Sicker" <bo...@gmail.com> wrote:
>
>> Oh, and all the Loggers in log4j-api unit tests are TestLoggers unless
>> you override that system property in the test class. So nothing new to add
>> support for that.
>>
>> On 13 February 2016 at 21:40, Matt Sicker <bo...@gmail.com> wrote:
>>
>>> It's set up as a custom log4j provider with a corresponding
>>> LoggerContext and LoggerContextFactory. If you wanna use your own, you can
>>> override the default via the system property log4j2.loggerContextFactory,
>>> though I'm not sure that's what you're asking.
>>>
>>> On 13 February 2016 at 17:54, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>>> Hi All:
>>>>
>>>> Any hints on how to hook up a new logger to work like a TestLogger in:
>>>>
>>>>
>>>> org.apache.logging.log4j.LoggerTest.flowTracingString_ObjectArray2_ParameterizedMessageFactory()
>>>>
>>>> ?
>>>>
>>>> Thank you,
>>>> Gary
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <http://www.manning.com/bauer3/>
>>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>>> Spring Batch in Action <http://www.manning.com/templier/>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Unit test question

Posted by Gary Gregory <ga...@gmail.com>.
I made a silly mistake in the original version of the test. Fixed now.
Thanks Matt!

Gary
On Feb 13, 2016 7:42 PM, "Matt Sicker" <bo...@gmail.com> wrote:

> Oh, and all the Loggers in log4j-api unit tests are TestLoggers unless you
> override that system property in the test class. So nothing new to add
> support for that.
>
> On 13 February 2016 at 21:40, Matt Sicker <bo...@gmail.com> wrote:
>
>> It's set up as a custom log4j provider with a corresponding LoggerContext
>> and LoggerContextFactory. If you wanna use your own, you can override the
>> default via the system property log4j2.loggerContextFactory, though I'm not
>> sure that's what you're asking.
>>
>> On 13 February 2016 at 17:54, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>>> Hi All:
>>>
>>> Any hints on how to hook up a new logger to work like a TestLogger in:
>>>
>>>
>>> org.apache.logging.log4j.LoggerTest.flowTracingString_ObjectArray2_ParameterizedMessageFactory()
>>>
>>> ?
>>>
>>> Thank you,
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>

Re: Unit test question

Posted by Matt Sicker <bo...@gmail.com>.
Oh, and all the Loggers in log4j-api unit tests are TestLoggers unless you
override that system property in the test class. So nothing new to add
support for that.

On 13 February 2016 at 21:40, Matt Sicker <bo...@gmail.com> wrote:

> It's set up as a custom log4j provider with a corresponding LoggerContext
> and LoggerContextFactory. If you wanna use your own, you can override the
> default via the system property log4j2.loggerContextFactory, though I'm not
> sure that's what you're asking.
>
> On 13 February 2016 at 17:54, Gary Gregory <ga...@gmail.com> wrote:
>
>> Hi All:
>>
>> Any hints on how to hook up a new logger to work like a TestLogger in:
>>
>>
>> org.apache.logging.log4j.LoggerTest.flowTracingString_ObjectArray2_ParameterizedMessageFactory()
>>
>> ?
>>
>> Thank you,
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Unit test question

Posted by Matt Sicker <bo...@gmail.com>.
It's set up as a custom log4j provider with a corresponding LoggerContext
and LoggerContextFactory. If you wanna use your own, you can override the
default via the system property log4j2.loggerContextFactory, though I'm not
sure that's what you're asking.

On 13 February 2016 at 17:54, Gary Gregory <ga...@gmail.com> wrote:

> Hi All:
>
> Any hints on how to hook up a new logger to work like a TestLogger in:
>
>
> org.apache.logging.log4j.LoggerTest.flowTracingString_ObjectArray2_ParameterizedMessageFactory()
>
> ?
>
> Thank you,
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <bo...@gmail.com>