我对Web服务世界还很陌生,但对此有所了解log4j.
我需要实现一个功能,它将日志消息发送到Web服务,而不是使用Web服务appender发送到文件.
我通过在谷歌上搜索这WebServiceAppender是一个log4j类,但我无法验证这一点.
log4j.appender.CONSOLE=main.WSAppender
log4j.appender.CONSOLE.endpoint=http://localhost:8080/Logging/services/logging?w??sdl
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) :: %m%n
WSAppender.java extends AppenderSkeleton, can't resolve endpoint, hostname in append()
if (endpoint == null) {
System.out.println("no endpoint set. Check configuration file");
System.out.println("[" + hostname + "] " + this.layout.format(event));
return;
}
Run Code Online (Sandbox Code Playgroud)