I think most people just use the config file that you are checking for
being null there to setup logging.

If you have to make sure it works sans that file though, you could
extend RemoteServiceServlet (which extends HttpServlet, which extends
GenericServlet, which has a method called "init" that is commonly
used), and then make all your RPC extend that. Your code won't be
portable to other projects outside of your own that way (unless you
provide your extensions too), but maybe that's not a concern for you
anyway.

On Jan 25, 7:16 pm, phamtranquocviet <[email protected]>
wrote:
> Hi,
>
> I want to log all errors happened on the server side to a single file.
> Unlike a java application, GWT RPC does not have a main function.
> Where can I put the codes shown below?
>
> Here is my future codes:
>
> if(System.getProperty("java.util.logging.conf.class) == null &&
>    System.getProperty("java.util.logging.config.file") == null)
> {
>    try
>    {
>       Logger.getLogger("").setLevel(Level.ALL);
>       final int LOG_ROTATION_COUNT = 10;
>       Handler handler = new FileHandler("%h/myapp.log", 0,
> LOG_ROTATION_COUNT);
>       Logger.getLogger("").addHandler(handler);
>    }
>    catch (IOException e)
>    {
>       logger.log(Level.SEVERE, "Can't open file", e);
>    }
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to