b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

log4j appender自定义_log4j routingappender_fileappender log4j(36)

电脑杂谈  发布时间:2017-01-30 04:04:43  来源:网络整理

38+ "; charset=UTF-8");

39headers.setHeader("Content-Transfer-Encoding",

40"quoted-printable");

41part = new MimeBodyPart(headers, os.toByteArray());

42} catch (Exception ex) {

43StringBuffer sbuf = new StringBuffer(s);

44for (int i = 0; i < sbuf.length(); i++) {

45if (sbuf.charAt(i) >= 0x80) {

46sbuf.setCharAt(i, &#39;?&#39;);

47}

48}

49part = new MimeBodyPart();

50part.setContent(sbuf.toString(), layout.getContentType());

51}

52}

53

54Multipart mp = new MimeMultipart();

55mp.addBodyPart(part);

56msg.setContent(mp);

57

58msg.setSentDate(new Date());

59Transport.send(msg);

60} catch (MessagingException e) {

61LogLog.error("Error occured while sending e-mail notification.", e);

62} catch (RuntimeException e) {

63LogLog.error("Error occured while sending e-mail notification.", e);

64}

65 }

66 protected String formatBody() {

67StringBuffer sbuf = new StringBuffer();

68String t = layout.getHeader();

69if (t != null)

70sbuf.append(t);

71int len = cb.length();

72for (int i = 0; i < len; i++) {

73LoggingEvent event = cb.get();

74sbuf.append(layout.format(event));

75if (layout.ignoresThrowable()) {

76String[] s = event.getThrowableStrRep();

77if (s != null) {

78for (int j = 0; j < s.length; j++) {

79sbuf.append(s[j]);

80sbuf.append(Layout.LINE_SEP);

81}

82}

83}

84}

85t = layout.getFooter();

86if (t != null) {

87sbuf.append(t);

88}

89return sbuf.toString();

90 }

SocketAppender类

SocketAppender将日志消息(LoggingEvent序列化实例)发送到指定Host的port端口。在创建SocketAppender时,SocketAppender会根据设置的Host和端口建立和远程服务器的链接,并创建ObjectOutputStream实例。


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-29497-36.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...