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

log4j appender自定义_log4j routingappender_fileappender log4j(18)

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

30return;

31} catch (java.net.ConnectException e) {

32LogLog.debug("Remote host " + address.getHostName()

33+ " refused connection.");

34} catch (IOException e) {

35if (e instanceof InterruptedIOException) {

36Thread.currentThread().interrupt();

37}

38LogLog.debug("Could not connect to "

39+ address.getHostName() + ". Exception is " + e);

40}

41}

42}

43 }

而后,在每一次日志记录请求时只需将LoggingEvent实例序列化到之前创建的ObjectOutputStream中即可,若该操作失败,则会重新建立Connector线程以隔时检测远程日志服务器可以重新链接。

1 public void append(LoggingEvent event) {

2if (event == null)

3return;

4if (address == null) {

5errorHandler

6.error("No remote host is set for SocketAppender named \""

7+ this.name + "\".");

8return;

9}

10if (oos != null) {

11try {

12if (locationInfo) {

13event.getLocationInformation();

14}

15if (application != null) {

16event.setProperty("application", application);

17}

18event.getNDC();

19event.getThreadName();

20event.getMDCCopy();

21event.getRenderedMessage();

22event.getThrowableStrRep();

23oos.writeObject(event);

24oos.flush();

25if (++counter >= RESET_FREQUENCY) {

26counter = 0;

27// Failing to reset the object output stream every now and

28// then creates a serious memory leak.

29// System.err.println("Doing oos.reset()");

30oos.reset();

31}

32} catch (IOException e) {

33if (e instanceof InterruptedIOException) {

34Thread.currentThread().interrupt();

35}

36oos = null;

37LogLog.warn("Detected problem with connection: " + e);

38if (reconnectionDelay > 0) {

39fireConnector();

40} else {

41errorHandler


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

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

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