Lines 97-105
Link Here
|
97 |
int syslogFacility = LOG_USER; |
97 |
int syslogFacility = LOG_USER; |
98 |
String facilityStr; |
98 |
String facilityStr; |
99 |
boolean facilityPrinting = false; |
99 |
boolean facilityPrinting = false; |
|
|
100 |
int maxPacketLength = SyslogWriter.DEFAULT_MAX_PACKET_LENGTH; |
100 |
|
101 |
|
101 |
//SyslogTracerPrintWriter stp; |
102 |
//SyslogTracerPrintWriter stp; |
102 |
SyslogQuietWriter sqw; |
103 |
SyslogQuietWriter sqw; |
|
|
104 |
SyslogWriter sw; |
103 |
String syslogHost; |
105 |
String syslogHost; |
104 |
|
106 |
|
105 |
/** |
107 |
/** |
Lines 283-289
Link Here
|
283 |
// of 1024 bytes, then write it |
285 |
// of 1024 bytes, then write it |
284 |
// (must allow for up 5to 5 characters in the PRI section |
286 |
// (must allow for up 5to 5 characters in the PRI section |
285 |
// added by SyslogQuietWriter) |
287 |
// added by SyslogQuietWriter) |
286 |
if (byteCount <= 1019) { |
288 |
if (byteCount <= (maxPacketLength-5)) { |
287 |
sqw.write(packet); |
289 |
sqw.write(packet); |
288 |
} else { |
290 |
} else { |
289 |
int split = header.length() + (packet.length() - header.length())/2; |
291 |
int split = header.length() + (packet.length() - header.length())/2; |
Lines 388-395
Link Here
|
388 |
*/ |
390 |
*/ |
389 |
public |
391 |
public |
390 |
void setSyslogHost(final String syslogHost) { |
392 |
void setSyslogHost(final String syslogHost) { |
391 |
this.sqw = new SyslogQuietWriter(new SyslogWriter(syslogHost), |
393 |
this.sw = new SyslogWriter(syslogHost); |
392 |
syslogFacility, errorHandler); |
394 |
sw.setMaxPacketLength(maxPacketLength); |
|
|
395 |
this.sqw = new SyslogQuietWriter(sw, syslogFacility, errorHandler); |
393 |
//this.stp = new SyslogTracerPrintWriter(sqw); |
396 |
//this.stp = new SyslogTracerPrintWriter(sqw); |
394 |
this.syslogHost = syslogHost; |
397 |
this.syslogHost = syslogHost; |
395 |
} |
398 |
} |
Lines 403-408
Link Here
|
403 |
} |
406 |
} |
404 |
|
407 |
|
405 |
/** |
408 |
/** |
|
|
409 |
*/ |
410 |
public |
411 |
void setMaxPacketLength(final int maxPacketLength) { |
412 |
this.maxPacketLength = maxPacketLength; |
413 |
if (sw != null) { |
414 |
sw.setMaxPacketLength(maxPacketLength); |
415 |
} |
416 |
} |
417 |
|
418 |
/** |
419 |
Returns the value of the <b>SyslogHost</b> option. |
420 |
*/ |
421 |
public |
422 |
int getMaxPacketLength() { |
423 |
return maxPacketLength; |
424 |
} |
425 |
|
426 |
/** |
406 |
Set the syslog facility. This is the <b>Facility</b> option. |
427 |
Set the syslog facility. This is the <b>Facility</b> option. |
407 |
|
428 |
|
408 |
<p>The <code>facilityName</code> parameter must be one of the |
429 |
<p>The <code>facilityName</code> parameter must be one of the |