users@glassfish.java.net

Re: Instance name in Log Handler?

From: <glassfish_at_javadesktop.org>
Date: Mon, 20 Jul 2009 05:05:27 PDT

> is there a way to find out the instance name from a
> custom log handler?

Did you check the Java System properties? Just find out the PID of the running Glassfish via "jps" and displays the current properties using "jinfo <PID>". Then you will find the property name for the current instance:

  $ jinfo -sysprops 32465|grep com.sun.aas
  ...
  com.sun.ass.domainName = domain1
  ...

> We are thinking of implementing a very simplistic
> custom log handler to send all logs to a central
> place, but we need to mark each log message with the
> proper sender, so to speak - and instance name would
> be perfect for our use cases.

Did you check SLF4J? They also have a java.util.logging (JUL) bridge deployable as Glassfish custom log handler.

Cheers, Jörg
[Message sent by forum member 'jthoennes' (jthoennes)]

http://forums.java.net/jive/thread.jspa?messageID=356537