Solved

Log4J parameters

Posted on 2007-11-19
1
865 Views
Last Modified: 2012-05-05
I am using log4J for logging. Is there a way to determine, how log4J saves these parameters,so that I can perform some sort of testing.
This is what I would like to do: I have various appenders, which are defined in the log4J configuration- so for my Junit test cases, I would like to call say method a ,which uses one sort of appender- then I would like to check and see if what log4j is using is the same sort of appender.This way,if anyone changes the config then this test would fail.
Thanks
0
Comment
Question by:ams7503
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
cmalakar earned 50 total points
ID: 20318085
User org.apache.log4j.Logger class and its getAppender or getAllAppenders method to find out the configured appenders
0

Featured Post

Industry Leaders: 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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

740 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