Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log message in SystemOut.log in WAS5.1x using Sun's logging API

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I log messages in Application Server log (e.g., log message in SystemOut.log in WebSphere App Server) using Logging classes from Sun?

I am using code below:

import java.util.logging.*;

private static ConsoleHandler c1 = new ConsoleHandler();
logger.addHandler(c1);
logger.log(Level.WARNING, "Exception thrown while connecting to LDAP.", e);

ConsoleHandler only logs message in console, not in application log.

What do I need to do to log message in log file of app server?

I have used Log4J for this purpose before. But would like to be lightweight and would like to use Sun's own logging.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic