Methods Summary |
---|
private synchronized javax.management.ObjectName | _enableLoggingHook()
debug( "_enableLoggingHook" );
if ( mLoggingImplHook != null )
{
throw new IllegalStateException();
}
mMBeanServer = FeatureAvailability.getInstance().waitForMBeanServer();
LoggingImplHook hook = null;
try
{
final Class loggingClass = Class.forName( LOGGING_IMPL_CLASSNAME );
final Constructor constructor = loggingClass.getConstructor( String.class );
hook = (LoggingImplHook)constructor.newInstance( mServerName );
final Method getObjectNameMethod =
loggingClass.getMethod( "getObjectName", String.class );
final ObjectName proposedObjectName = (ObjectName)getObjectNameMethod.invoke( hook, mServerName );
debug( "registering Logging as: " + proposedObjectName );
mLoggingObjectName = mMBeanServer.registerMBean( hook, proposedObjectName ).getObjectName();
mLoggingImplHook = hook;
}
catch ( Exception e )
{
hook = null;
final String msg = "Can't load " + LOGGING_IMPL_CLASSNAME + ", caught: " + e;
debug( msg );
throw new Error( msg, e);
}
debug( "_enableLoggingHook DONE" );
return mLoggingObjectName;
|
private final void | debug(java.lang.Object o) mDebug.println( o );
|
private void | dumpSystemProps(com.sun.appserv.management.helper.AMXDebugHelper output)
final java.util.Properties props = System.getProperties();
final String[] keys = (String[])props.keySet().toArray( new String[0] );
java.util.Arrays.sort( keys );
for( final String key : keys )
{
debug( key + "=" + props.getProperty( key ) );
}
|
public static javax.management.ObjectName | enableLoggingHook()Called exactly once to install the Logging MBean and turn on AMX support for logging.
return getInstance()._enableLoggingHook();
|
public static com.sun.enterprise.server.logging.AMXLoggingHook | getInstance()
return INSTANCE;
|
public java.util.logging.Level | getMinimumLogLevel()
return mMinimumLogLevel;
|
void | publish(java.util.logging.LogRecord record, java.util.logging.Formatter theFormatter)
if ( record.getLevel().intValue() < mMinimumLogLevel.intValue() )
{
return;
}
debug( "publish: " + theFormatter.format( record ) );
if ( mLoggingImplHook != null )
{
try
{
mLoggingImplHook.privateLoggingHook( record, theFormatter );
}
catch( Throwable t )
{
mDebug.println( "AMXLoggingHook.publish: Exception calling privateLoggingHook: ", t );
// squelch--we can't log it or we'll have a recursive call
}
}
|
public void | setMinimumLogLevel(java.util.logging.Level level)
mMinimumLogLevel = level;
|