/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if (errorCount == 0) { super.start(); } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if(errorCount == 0) { super.start(); } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
/** * This method gets the network name of the machine we are running on. * Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name * cannot be found. * @return String the name of the local host */ public String getLocalHostname() { try { InetAddress addr = InetAddress.getLocalHost(); return addr.getHostName(); } catch (UnknownHostException uhe) { addError("Could not determine local host name", uhe); return "UNKNOWN_LOCALHOST"; } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleFormat = new SimpleDateFormat("MMM dd HH:mm:ss", new DateFormatSymbols(Locale.US)); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if(errorCount == 0) { super.start(); } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleFormat = new SimpleDateFormat("MMM dd HH:mm:ss", new DateFormatSymbols(Locale.US)); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if(errorCount == 0) { super.start(); } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if (errorCount == 0) { super.start(); } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if (errorCount == 0) { super.start(); } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); localHostName = getLocalHostname(); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if (errorCount == 0) { super.start(); } }
public void start() { int errorCount = 0; String facilityStr = getFirstOption(); if (facilityStr == null) { addError("was expecting a facility string as an option"); return; } facility = SyslogAppenderBase.facilityStringToint(facilityStr); try { // hours should be in 0-23, see also http://jira.qos.ch/browse/LBCLASSIC-48 simpleMonthFormat = new SimpleDateFormat("MMM", Locale.US); simpleTimeFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); simpleTimeFormat.setDateFormatSymbols(new DateFormatSymbols(Locale.US)); simpleMonthFormat.setDateFormatSymbols(new DateFormatSymbols(Locale.US)); } catch (IllegalArgumentException e) { addError("Could not instantiate SimpleDateFormat", e); errorCount++; } if(errorCount == 0) { super.start(); } }