You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Cook, Lori A" <lo...@hp.com> on 2006/04/21 20:22:01 UTC

Window apps and logging

Okay

So you've got an application that creates a window application. The
class is something like this

public class TestPanels extends JFrame {
// private class constants
	private static final Logger logger =
	
Logger.getLogger(TestPanels.class.getName());
    ...
    public static void main(String args[]) {
    	logger.info("Entering main");
    	try {
    		new TestPanels().show();
    	} catch (Exception e) {
    		logger.error("", e);
    	}
    	logger.info("Exiting main");
    }
}

So you kick off the app, it posts a window and exits main. Now what? If
you cause an error in app where do you catch it and log? I.e. I'm
looking for the 'holy grail' of catching any unprocessed exceptions for
such a application so it can be logged.

Thanks for any help you can give.
Lori <*>

Re: Window apps and logging

Posted by James Stauffer <st...@gmail.com>.
http://java.sun.com/developer/JDCTechTips/2001/tt0109.html#handling  I
think there is another way to do it without getting into threads.

On 4/21/06, Cook, Lori A <lo...@hp.com> wrote:
> Okay
>
> So you've got an application that creates a window application. The
> class is something like this
>
> public class TestPanels extends JFrame {
> // private class constants
>         private static final Logger logger =
>
> Logger.getLogger(TestPanels.class.getName());
>     ...
>     public static void main(String args[]) {
>         logger.info("Entering main");
>         try {
>                 new TestPanels().show();
>         } catch (Exception e) {
>                 logger.error("", e);
>         }
>         logger.info("Exiting main");
>     }
> }
>
> So you kick off the app, it posts a window and exits main. Now what? If
> you cause an error in app where do you catch it and log? I.e. I'm
> looking for the 'holy grail' of catching any unprocessed exceptions for
> such a application so it can be logged.
>
> Thanks for any help you can give.
> Lori <*>
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org