[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

log4j: controlling junit test logging

Posted on 2004-11-27
4
Medium Priority
?
1,323 Views
Last Modified: 2006-11-17
Hi,

- I'm logging from my regular code and my tests.
- I'm using the same log4j.properties file

Is there any way to disable all logging for all my tests? I still want to see output from my non-junit code.

I was thinking since they all extend from junit.framework.TestCase that there might be a way to control it for every object that descends from TestCase. But I can't figure it out. Any suggestions?
0
Comment
Question by:ycomp
  • 3
3 Comments
 

Accepted Solution

by:
ClazzeFlits earned 1500 total points
ID: 12695936
Try this putting in your log4j.properties file:

name_of_your_package_where_your_tests_are_located=INFO
0
 

Expert Comment

by:ClazzeFlits
ID: 12898146
I have to correct myself.
It has to be:

log4.logger.name_of_your_package_where_your_tests_are_located=INFO
0
 

Expert Comment

by:ClazzeFlits
ID: 12898153
typo,

log4j.logger.name_of_your_package_where_your_tests_are_located=INFO
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question