Kayser
Kayser

Reputation: 6694

How to log on the server part in a GWT project

I have a GWT project. I use standard Logger for the client side and server side logging. I created two Logger classes which inherit from java.util.logging.Logger. Client part works properly. The problem is on the server part. I have a logger class like:

public class ServerLogger extends Logger {

public ServerLogger() throws SecurityException, IOException {
    super("ServerLog", null);
    boolean append = true;
    FileHandler fileHandler = new FileHandler("My.log", append);
    fileHandler.setFormatter(new SimpleFormatter());
    addHandler(fileHandler);
}
}

But it does not create any log file and it does not log anything?? (The file should stay on the server part.)

How should I log on the server part??

Upvotes: 0

Views: 1322

Answers (1)

Daniel Kurka
Daniel Kurka

Reputation: 7985

Your question has nothing to do with GWT. This is just logging in java.

There are many solutions to do this, but since you mentioned java.util.Logging here is a good blogpost on how to get started with java.util.logging in a servlet container: http://www.crazysquirrel.com/computing/java/logging.jspx

Upvotes: 2

Related Questions