public static int getFacility ( String facilityName ) { if ( facilityName != null ) { facilityName = facilityName . trim ( ) ; } if ( "KERN" . equalsIgnoreCase ( facilityName ) ) { return LOG_KERN ; } else if ( "USER" . equalsIgnoreCase ( facilityName ) ) { return LOG_USER ; } else if ( "MAIL" . equalsIgnoreCase ( facilityName ) ) { return LOG_MAIL ; } else if ( "DAEMON" . equalsIgnoreCase ( facilityName ) ) { return LOG_DAEMON ; } else if ( "AUTH" . equalsIgnoreCase ( facilityName ) ) { return LOG_AUTH ; } else if ( "SYSLOG" . equalsIgnoreCase ( facilityName ) ) { return LOG_SYSLOG ; } else if ( "LPR" . equalsIgnoreCase ( facilityName ) ) { return LOG_LPR ; } else if ( "NEWS" . equalsIgnoreCase ( facilityName ) ) { return LOG_NEWS ; } else if ( "UUCP" . equalsIgnoreCase ( facilityName ) ) { return LOG_UUCP ; } else if ( "CRON" . equalsIgnoreCase ( facilityName ) ) { return LOG_CRON ; } else if ( "AUTHPRIV" . equalsIgnoreCase ( facilityName ) ) { return LOG_AUTHPRIV ; } else if ( "FTP" . equalsIgnoreCase ( facilityName ) ) { return LOG_FTP ; } else if ( "LOCAL0" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL0 ; } else if ( "LOCAL1" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL1 ; } else if ( "LOCAL2" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL2 ; } else if ( "LOCAL3" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL3 ; } else if ( "LOCAL4" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL4 ; } else if ( "LOCAL5" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL5 ; } else if ( "LOCAL6" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL6 ; } else if ( "LOCAL7" . equalsIgnoreCase ( facilityName ) ) { return LOG_LOCAL7 ; } else { return - 1 ; } }
Returns the integer value corresponding to the named syslog facility or - 1 if it couldn t be recognized .