One JVM with different system.out / system.err files

I have a menu application which allows me to launch different swingapps which runs inside one single JVM.
All applications have their own properties.file which is read and handled at the start of each application.
One property allows me to print all kind of system.err / system.out which i want to redirect to a specific file. This is implemented with following code:
        if (isTRACE_ENABLED()){
            try {
                setTrace_out_log(new PrintStream(
                          new BufferedOutputStream(
                                new FileOutputStream(props.getProperty("TRACE_OUTLOG_FILE")),128), true));
                System.setOut(getTrace_out_log());
                setTrace_err_log(new PrintStream(
                        new BufferedOutputStream(
                              new FileOutputStream(props.getProperty("TRACE_ERRLOG_FILE")),128), true));
                System.setErr(getTrace_err_log());
            } catch(IOException e) {
                e.printStackTrace();
        }This works file but... all system.out and system.err is redirected to same file... which is not what i want.
Example:
debug property for menu application = enabled
debug property for app 1 = disabled
debug property for app 2 = enabled
In above case i want to have 4 new files:
- menuapp_out
- menuapp_err
- app2_out
- app2_err
This doesn't work, the files are created but after starting app2, the print-statements for the menu application are alse redirected to the app_2_xxx files. And when i finish app2, i do not get any print-output anymore
IMHO this is because the JVM only has 1 system.out and 1 system.err file. Is there some way to solve this?

I understand that i need to use java.util.logger (JUL) or Log4j
Are there any (free) tools availabe to read/analyze the logfiles created by above tools?

Similar Messages

  • Wifi sync 2 iPhones in one iTunes with different Apple-ID's.

    Wifi sync 2 iPhones in one iTunes with different Apple-ID's. My Phone will show up in iTunes, my wife's wont. After plugging my wife's phone into my Win 8.1 pc and check Sync over wifi, I hit the eject button, could this be the reason? Or might it be the different Apple-ID's? If the answer is the first, is there any way tohave iTunes forgetmy wife's phone so I can addit from scratch?

    Ello,
    I know this, but thats in the past now sadly. The question is: Why wont my wife's iPhone show up in iTunes via wifi?
    Is it because I pushed the eject button? And if so, is there any way I can make iTunes forget my wife's iPhone and *** it from scratch again?
    Or is it because the phones uses different Apple-ID's?

  • One Key FIgure in more than one column with different restrictions

    Hi,
      I am using a key figure in more than one column with different restrictions, but restriction in one column is affecting the result in other column. What shall i do to make it independent from one another??

    Hi Pravender Chauhan,
        If you want in Single column different value for different Rows based on same Key Figure, you can create Structure where you can define different logic for each row but using same key figure.
    If you want to use different Key figures then you should have to Restricted Key Figure and for any calculation you can use calculated Key figure.
    Assign points if Useful.
    Regards,
    Rajdeep.

  • Okay can you have more than one account on one computer with different e-mails

    Okay can you have more than one account on one computer with different e-mails

    Yes for iTunes....started a new account and when I try to sign in to the store it gives me a message that this id hasn't been used and would you like to review at which time then it tells me your request cannot be completed and to check date on computer and the cookies well the date is correct and not sure what or how to alter the cookies..I turned firewall off and tried that but still no luck...also deleted temp cookies and still having problems..I have been trying to fix this for days and just about to give up any ideas

  • Passing System.out/System.err as parameters

    I'm sure there must be a simple answer to this that I'm just not seeing, suggestions please.
    I have a method in a logging utility that takes either a PrintWriter or a Printstream parameter as a target for logging and a second method that closes the log.
    In principle either System.out or System.err could be passed in either directly or wrapped in a PrintWriter.
    In the closing method I want to determine if one of these two PrintStreams were passed and if so skip the close() operation so as not to lose connectivity to stdout or stderr.
    In the case of the PrintStream parameter I can use an identity check and condition a boolean to control closing the file.
    The problem is the PrintWriter, if the utility user wraps these PrintStreams.
    1: As I understand it closing the PrintWriter will cause the underlying OutputStream to close.
    2: Since it's a protected field the underlying OutputStream is not visible to me.
    3: I don't wish to subclass PrintWriter if there's another way to solve the problem.
    Any ideas?

    Why don't you use a BufferedWriter() ?

  • Communicate with different R/3 Systems

    Hi, SDN W/F expert.!
    I have some question about SAP W/F.
    We have two SAP R/3 systems to share a work flow each others.
    In that case, Is it possible to implement this kinds of W/F?
    If one employee requests something to be accepted from a boss,
    the man only accept the document. but the boss is a SAP user in another R/3 system.
    How can I solve these problems???
    Let me know on that..

    Hi Junha,
          As I understand from ur requirement. in One system the employee is creating a request and the request will be reviewed ( and acted upon) by the boss in system 2 . If this is the situation then I would suggest in request transaction u do a RFC call to SWE_CREATE_EVENT providing it the destination of system 2. By this as soon as the request is created in System1 it will trigger a WF in system 2. (ofcourse the WF will be developed in system 2)  U can find the destination in transaction SM59. Similarly the Boss' action might be captured via a different workflow in system 1 .
    I hope I am clear and helpful enuf !
    Regards,
    Anuj Sethi

  • URGENT : System.out AND OACorexx files! log files more than 4Giga

    Hi all,
    I have a client with a custom done in OAF where there are a lot of System.out... and System.err "logs" print.
    The problem is that these logs are written in OACorexxx files under Apache/Jserv/logs/jvm directory: in only 4 days more than 4G size!
    Is possible to disable this logs?
    Thanks,
    Carlo

    Calling java.lang.System.setOut(PrintStream out) will allow you to redirect the System.out calls. You can direct them to null.
    --Shiv                                                                                                                                                                                                                                                                               

  • Redirecting system.out to a file

    I want to have the output of these threads go to a file, which it is doing now, but the program is finishing before all the data is written to the file.
    I had another idea that the threads could write to a shared stringbuffer and then when they have finished, i could write the contents of that stringbuffer to a file, but when do it tell it to write to the file. how can i tell when the threads are finished.
    /*      12 Nov 2002
         Class extends PThread which extends Thread.
    import Concurrency.*;
    import java.io.*; //added to write output to a file
    public class Exercise1 extends PThread{
         private static File theOutputFile;
         private static FileWriter fileWriterStream;
         private static int counter = 0;
         public Exercise1() {
              try {
                   if(theOutputFile == null) {
                        theOutputFile = new File("output.txt");
                        fileWriterStream = new FileWriter(theOutputFile);
              }catch(IOException ioe){}     
         public static void main(String[] args) throws IOException {
              System.out.println("Dave Casserly\n" +
                                       "Check the source folder for a file called output.txt\n" +
                                       "This contains the programs output.\n");
              Exercise1 thread1 = new Exercise1();
              Exercise1 thread2 = new Exercise1();
              thread1.start();
              thread2.start();
         //each thread will look at counter make sure its less than 1000,
         //get the current counter value and increment it
         //print it to screen
         //then increment the static counter
         public void run(){
              try {
                   while(counter <= 1000) {
                        int count = counter;
                        count++;
                        counter++;
                        System.out.println("COUNT = " + count);                    //write to screen
                        fileWriterStream.write("COUNT = " + count + "\n");      //write to file
                        counter = count;     
              }catch(IOException io){}     
    }//end of class

    You need to join the main thread with the child threads.
    Something like this:
      Exercise1 thread1 = new Exercise1();
      Exercise1 thread2 = new Exercise1();
      thread1.start();
      thread2.start();
      thread2.join();
      thread1.join();Or something.

  • Java Beans System.out.println Log file

    Helllo,
    I have Forms 11.1.2 installed on linux. I developed a java bean and put some System.out.println() statements. The bean itself is working but where do i look for the debug statement logs that i am generating via System.out.println() statements.
    Please let me know if you need more information, I will post asap.
    thanks in advance,
    Prasad.

    Prabodh,
    thanks, added the following line to the implementation class in java bean:
    private final static Logger logger = Logger.getLogger(MyBean.class.getName());
    and then in the init() method, i put
    logger.info("Prasad .... in init);
    Does this automatically goes into weblogic managed server WLS_FORMS (in my case) standard out?
    Or do i need to do anything else, i know weblogic comes up with its own diagnostic logging and is famous for supressing other loggers.... just want to run this by you as well.
    thanks,
    Prasad,

  • One landscape with different databases releases

    Dears,
    A customer have MSSQL 2000 installed on your systems DEV and QAS. The PRD system does not installed.
    Now the customer need install only the production system, but he want with MSSQL 2005.
    Does have problems? What SAP recommend?
    Thanks,
    Dejalma Rodrigues

    Hi,
    It is possible to have different releases of DB within a landscape <u>as long as the same release of the SAP application supports it</u>. The end users will not see any difference.
    The challenge is support for DB patching if you don't have anywhere to replicate production issues. Not to mention possible issues with different DB tuning parameters and back-up recovery processes.
    I would suggest that you <b>at least</b> upgrade the QAS system to SQL Server 2005 too in the short term. The recommendation you will always get is to have all 3 aligned on the same release - that should be your longer term goal.
    Cheers,
    Mike

  • Two iPods on one cumputer with different songs

    I can't find out how to put two ipods with different music on one cumputer and how to put songs on one iPod and not the other. if you know how plz help!

    Additional links and help...
    Using iPod with multiple computers
    http://docs.info.apple.com/article.html?artnum=61675
    Managing content manually on iPod
    http://docs.info.apple.com/article.html?artnum=61148
    iPod: Frequently Asked Questions
    http://docs.info.apple.com/article.html?artnum=60920
    Patrick

  • HT204053 We have two Iphone 4S but we set each one up with different accounts, how can we share purchased or downloaded music from and iTunes card without purchasing twp different cards?

    We have two Iphone 4s with different accounts, what would we need to do to share music from and Itune card if one of us purchased and the other did not?

    Put all of the music on the computer(s) to which you sync, then sync to your idevices

  • How to maintain one vendor with differant plants at differant states.

    Dear All,
    i have one scenario with me in that my client purchasing his goods from one vendor that vendor is having two plants one at mumbai & one at gujarat. Now how i will maintain these two address with the same vendor. Along with that i need to mainatin the tax structure for both in one vendor. While creating purchase order how buyer will pick the tax structure.
    Regards,
    Nandkishor Nachane

    Hi,
      You can create one main vendor code and use partne function to add address of different plant location.
    regards,
    zafar

  • In MIRO,more than one PO with different vendors than also system is posting

    Dear All,
    When in MIRO, vendor invoice is posting with reference to more than one PO's and if vendors are different in PO's then also system is posting vendor invoice and in this case, system is considering vendor of first mentioned PO and posting the document. This is error found to be in factory business process and need to be controlled immediately, otherwise any repercussions can be faced in future.
    Can anyone advice how to control this.
    Thanks
    Madhukar Mittal

    Hi,
    The system will take over the invoicing party from the first PO and                
    ignore the invoice party from other POs.                                           
    You can see it in Detail tab in MIRo (or in MIR4). This is standard funktionality.                                                                               
    Please check the information from the following notes.                             
    393431                                                                             
    458692   
    Best regards
    Erika

  • Photosmart 6180 all-in-one printer with error meesage "Ink System has failed"

    The printer is 3 years old and has been working fine until this week.  I now receive a 0xc1820206 error code after the "Ink System has failed" message appeared.  I tried unplugging the power cord and removing all the cartridges.  Unfortunately, after completing the instructions from the troubleshooting section and turning the printer back on, I immediately receive the error message again before I submit any print job.  Does anyone know what specifically the error code means or have anything else I can try like cleaning printheads or something? The printer is attached to an Apple Imac with the snow leopard operating system MAC 10.6
    Thank you for any suggestions. 

    The likely issue is the "plumbing" rather than the electronics.  There are various pumps and tubing that make up the ink delivery system.  Performing a reset as shown here may resolve the issue.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for

  • Apex_util.get_print_document in sql developer

    I have not been successful in getting apex_util.get_print_document to work in sql developer, the return value is always null and inserted into the table. Inside of APEX it works fine, so I figured I had to set workspace id, but that did not help. Her

  • Toast with a Blu-ray external writer?

    Hello everybody! I am very frustrated because I just got the Samsung writer for Mac and Windows...and is not compatible with Mac...so a waste of money, and now I need to buy a real Blu-ray DVD burner for Mac... I see a lot of people using Toaster...m

  • Excel graphs into InDesign

    I want to insert my results into InDesign and they are currently displayed as an Excel graph. Direct copy and paste doesn't allow me to resize the graph. Not sure what to do? Thanks!

  • Iphoto sync loses pictures on computer

    I have iphoto 2 from when I bought my G4. I wanted to import my 1300 photos from iphoto to my ipod video, but it said my iphoto was too outdated. So i chose what i thought was my only other option, to synchronize photos from my 'albums' section. But

  • CS3 - preview buttons not appearing in "bar" where they used to

    Hello! I am using OS 10.5.8 and Dreamweaver CS3 Version 9 Build 3481. In earlier versions of Dreamweaver, there used to be preview buttons/icons, as well as upload buttons/icons, in the "bar" at the top of the window of the page I was creating. Inste