Advertisement

07.17.2008 at 01:03PM PDT, ID: 23574734
[x]
Attachment Details

log4j - multiple logs in one class

Asked by allelopath in Java Programming Language

I have a problem with multiple logs in one class.
The problem is that the logs are being written, but then when the program is done, the files are being erased (contain nothing). I can see the log files fill up as the program goes along, so I know stuff is being written.

     FileAppender appender1 = null;
     try {
       myAppender1 = new FileAppender("file1.log",false);
     } catch(Exception e) {}

     logger1.addAppender(appender1);
     logger1.setLevel((Level) Level.INFO);
     
     FileAppender appender2 = null;
     try {
       myAppender2 = new FileAppender("file2.log",false);
     } catch(Exception e) {}

     logger2.addAppender(appender2);
     logger2.setLevel((Level) Level.INFO);
     Start Free Trial
[+][-]07.17.2008 at 01:45PM PDT, ID: 22030098

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:08PM PDT, ID: 22030347

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:19PM PDT, ID: 22030476

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:20PM PDT, ID: 22030486

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:31PM PDT, ID: 22030592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:40PM PDT, ID: 22030686

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:58PM PDT, ID: 22030831

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 03:03PM PDT, ID: 22030866

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 03:37PM PDT, ID: 22031056

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Sign Up Now!
Solution Provided By: objects
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.17.2008 at 06:07PM PDT, ID: 22031860

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 06:10PM PDT, ID: 22031897

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:36AM PDT, ID: 22034595

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628