• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sun's Logger to log message in App Server log (SystemOut.log in WAS)

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few thoughts...

- I was under the impression anything that went to the console also goes to one of the log files such as System.out or System.err. I believe there was a bug in a 6.0 version of WAS where log files and console messages became out of sync, so I'd check your patch version. WAS6 requires a lot of patches.

- Use Log4J. It's better and more configurable, although this has nthing to do with your question.

- I believe there's multiple settings in the admin console that can control logging features. Search the admin console for a sub-group "Logging", I don't recall that exact name but it should be part of a server instance.
 
reply
    Bookmark Topic Watch Topic
  • New Topic