1 16 17 package org.apache.log4j.helpers; 18 19 20 21 import java.io.Writer ; 22 import org.apache.log4j.spi.ErrorHandler; 23 24 30 public class SyslogQuietWriter extends QuietWriter { 31 32 int syslogFacility; 33 int level; 34 35 public 36 SyslogQuietWriter(Writer writer, int syslogFacility, ErrorHandler eh) { 37 super(writer, eh); 38 this.syslogFacility = syslogFacility; 39 } 40 41 public 42 void setLevel(int level) { 43 this.level = level; 44 } 45 46 public 47 void setSyslogFacility(int syslogFacility) { 48 this.syslogFacility = syslogFacility; 49 } 50 51 public 52 void write(String string) { 53 super.write("<"+(syslogFacility | level)+">" + string); 54 } 55 } 56 | Popular Tags |