FileDocCategorySizeDatePackage
SystemLogHandler.javaAPI DocGlassfish v2 API3867Fri May 04 22:35:44 BST 2007com.sun.enterprise.server.logging

SystemLogHandler

public class SystemLogHandler extends Handler

Fields Summary
private static final String
SYSLOG_FILE_PREFIX
private String
syslogFileName
Constructors Summary
public SystemLogHandler()


       
        try {
            System.loadLibrary( "utilforsyslog" );
            // We will build the syslogFileName which will be in the format
            // SJSAS81_<ClusterId>_<ServerId>.log
            // This will let users to configure Syslog to send out all 
            // AppServer Logs running on different instances to log to
            // one central server, similarly can do the same at the
            // cluster level as well.
            String serverName = System.getProperty( 
                SystemPropertyConstants.SERVER_NAME );
            String clusterId = System.getProperty(
                SystemPropertyConstants.CLUSTER_NAME );
            if( clusterId != null ) {
                syslogFileName = syslogFileName + "_" + clusterId;
            }
            if( serverName != null ) {
                syslogFileName = syslogFileName + "_" + serverName;
            } 
            syslogFileName = syslogFileName + ".log";
        } catch( Exception e ) {
            System.err.println( "Exception in loading Syslog Library..." + e );
            e.printStackTrace( );
        }
    
Methods Summary
public voidclose()

 
public voidflush()

 
public native voidlogMessage(java.lang.String fileName, java.lang.String level, java.lang.String message)

public synchronized voidpublish(java.util.logging.LogRecord record)

        logMessage( syslogFileName, record.getLevel().toString(),
            getFormatter().format( record ) );