Merge branch 'reformat'
This commit is contained in:
commit
7380b94581
@ -14,20 +14,20 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides a Singleton interface for Syslog4j client implementations.
|
* This class provides a Singleton interface for Syslog4j client implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Usage examples:</p>
|
* <p>Usage examples:</p>
|
||||||
*
|
* <p/>
|
||||||
* <b>Direct</b>
|
* <b>Direct</b>
|
||||||
* <pre>
|
* <pre>
|
||||||
* Syslog.getInstance("udp").info("log message");
|
* Syslog.getInstance("udp").info("log message");
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p/>
|
||||||
* <b>Via Instance</b>
|
* <b>Via Instance</b>
|
||||||
* <pre>
|
* <pre>
|
||||||
* SyslogIF syslog = Syslog.getInstance("udp");
|
* SyslogIF syslog = Syslog.getInstance("udp");
|
||||||
* syslog.info();
|
* syslog.info();
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -126,14 +126,14 @@ public final class Syslog implements SyslogConstants {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Use createInstance(protocol,config) to create your own Syslog instance.
|
* Use createInstance(protocol,config) to create your own Syslog instance.
|
||||||
*
|
* <p/>
|
||||||
* <p>First, create an implementation of SyslogConfigIF, such as UdpNetSyslogConfig.</p>
|
* <p>First, create an implementation of SyslogConfigIF, such as UdpNetSyslogConfig.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Second, configure that configuration instance.</p>
|
* <p>Second, configure that configuration instance.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Third, call createInstance(protocol,config) using a short & simple
|
* <p>Third, call createInstance(protocol,config) using a short & simple
|
||||||
* String for the protocol argument.</p>
|
* String for the protocol argument.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Fourth, either use the returned instance of SyslogIF, or in later code
|
* <p>Fourth, either use the returned instance of SyslogIF, or in later code
|
||||||
* call getInstance(protocol) with the protocol chosen in the previous step.</p>
|
* call getInstance(protocol) with the protocol chosen in the previous step.</p>
|
||||||
*
|
*
|
||||||
|
@ -3,7 +3,7 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* Syslog4jVersion provides a unique version identifier that is created during
|
* Syslog4jVersion provides a unique version identifier that is created during
|
||||||
* the build process.
|
* the build process.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -3,14 +3,14 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* SyslogBackLogHandlerIF provides a last-chance mechanism to log messages that fail
|
* SyslogBackLogHandlerIF provides a last-chance mechanism to log messages that fail
|
||||||
* (for whatever reason) within the rest of Syslog.
|
* (for whatever reason) within the rest of Syslog.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Implementing the down(SyslogIF) method is an excellent way to add some sort of notification to
|
* <p>Implementing the down(SyslogIF) method is an excellent way to add some sort of notification to
|
||||||
* your application when a Syslog service is unavailable.</p>
|
* your application when a Syslog service is unavailable.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Implementing the up(SyslogIF) method can be used to notify your application when a Syslog
|
* <p>Implementing the up(SyslogIF) method can be used to notify your application when a Syslog
|
||||||
* service has returned.</p>
|
* service has returned.</p>
|
||||||
*
|
*
|
||||||
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* SyslogCharSetIF provides control of the encoding character set within
|
* SyslogCharSetIF provides control of the encoding character set within
|
||||||
* several class of Syslog4j.
|
* several class of Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,5 +15,6 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public interface SyslogCharSetIF extends Serializable {
|
public interface SyslogCharSetIF extends Serializable {
|
||||||
public String getCharSet();
|
public String getCharSet();
|
||||||
|
|
||||||
public void setCharSet(String charSet);
|
public void setCharSet(String charSet);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* SyslogConfigIF provides a common, extensible configuration interface for all
|
* SyslogConfigIF provides a common, extensible configuration interface for all
|
||||||
* implementations of SyslogIF.
|
* implementations of SyslogIF.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,55 +15,76 @@ public interface SyslogConfigIF extends SyslogConstants, SyslogCharSetIF {
|
|||||||
public Class getSyslogClass();
|
public Class getSyslogClass();
|
||||||
|
|
||||||
public int getFacility();
|
public int getFacility();
|
||||||
|
|
||||||
public void setFacility(int facility);
|
public void setFacility(int facility);
|
||||||
|
|
||||||
public void setFacility(String facilityName);
|
public void setFacility(String facilityName);
|
||||||
|
|
||||||
public int getPort();
|
public int getPort();
|
||||||
|
|
||||||
public void setPort(int port) throws SyslogRuntimeException;
|
public void setPort(int port) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public String getLocalName();
|
public String getLocalName();
|
||||||
|
|
||||||
public void setLocalName(String localName) throws SyslogRuntimeException;
|
public void setLocalName(String localName) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public String getHost();
|
public String getHost();
|
||||||
|
|
||||||
public void setHost(String host) throws SyslogRuntimeException;
|
public void setHost(String host) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public String getIdent();
|
public String getIdent();
|
||||||
|
|
||||||
public void setIdent(String ident);
|
public void setIdent(String ident);
|
||||||
|
|
||||||
public String getCharSet();
|
public String getCharSet();
|
||||||
|
|
||||||
public void setCharSet(String charSet);
|
public void setCharSet(String charSet);
|
||||||
|
|
||||||
public boolean isIncludeIdentInMessageModifier();
|
public boolean isIncludeIdentInMessageModifier();
|
||||||
|
|
||||||
public void setIncludeIdentInMessageModifier(boolean throwExceptionOnInitialize);
|
public void setIncludeIdentInMessageModifier(boolean throwExceptionOnInitialize);
|
||||||
|
|
||||||
public boolean isThrowExceptionOnInitialize();
|
public boolean isThrowExceptionOnInitialize();
|
||||||
|
|
||||||
public void setThrowExceptionOnInitialize(boolean throwExceptionOnInitialize);
|
public void setThrowExceptionOnInitialize(boolean throwExceptionOnInitialize);
|
||||||
|
|
||||||
public boolean isThrowExceptionOnWrite();
|
public boolean isThrowExceptionOnWrite();
|
||||||
|
|
||||||
public void setThrowExceptionOnWrite(boolean throwExceptionOnWrite);
|
public void setThrowExceptionOnWrite(boolean throwExceptionOnWrite);
|
||||||
|
|
||||||
public boolean isSendLocalTimestamp();
|
public boolean isSendLocalTimestamp();
|
||||||
|
|
||||||
public void setSendLocalTimestamp(boolean sendLocalTimestamp);
|
public void setSendLocalTimestamp(boolean sendLocalTimestamp);
|
||||||
|
|
||||||
public boolean isSendLocalName();
|
public boolean isSendLocalName();
|
||||||
|
|
||||||
public void setSendLocalName(boolean sendLocalName);
|
public void setSendLocalName(boolean sendLocalName);
|
||||||
|
|
||||||
public boolean isTruncateMessage();
|
public boolean isTruncateMessage();
|
||||||
|
|
||||||
public void setTruncateMessage(boolean truncateMessage);
|
public void setTruncateMessage(boolean truncateMessage);
|
||||||
|
|
||||||
public boolean isUseStructuredData();
|
public boolean isUseStructuredData();
|
||||||
|
|
||||||
public void setUseStructuredData(boolean useStructuredData);
|
public void setUseStructuredData(boolean useStructuredData);
|
||||||
|
|
||||||
public int getMaxMessageLength();
|
public int getMaxMessageLength();
|
||||||
|
|
||||||
public void setMaxMessageLength(int maxMessageLength);
|
public void setMaxMessageLength(int maxMessageLength);
|
||||||
|
|
||||||
public void addMessageModifier(SyslogMessageModifierIF messageModifier);
|
public void addMessageModifier(SyslogMessageModifierIF messageModifier);
|
||||||
|
|
||||||
public void insertMessageModifier(int index, SyslogMessageModifierIF messageModifier);
|
public void insertMessageModifier(int index, SyslogMessageModifierIF messageModifier);
|
||||||
|
|
||||||
public void removeMessageModifier(SyslogMessageModifierIF messageModifier);
|
public void removeMessageModifier(SyslogMessageModifierIF messageModifier);
|
||||||
|
|
||||||
public void removeAllMessageModifiers();
|
public void removeAllMessageModifiers();
|
||||||
|
|
||||||
public void addBackLogHandler(SyslogBackLogHandlerIF backLogHandler);
|
public void addBackLogHandler(SyslogBackLogHandlerIF backLogHandler);
|
||||||
|
|
||||||
public void insertBackLogHandler(int index, SyslogBackLogHandlerIF backLogHandler);
|
public void insertBackLogHandler(int index, SyslogBackLogHandlerIF backLogHandler);
|
||||||
|
|
||||||
public void removeBackLogHandler(SyslogBackLogHandlerIF backLogHandler);
|
public void removeBackLogHandler(SyslogBackLogHandlerIF backLogHandler);
|
||||||
|
|
||||||
public void removeAllBackLogHandlers();
|
public void removeAllBackLogHandlers();
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* SyslogConstants provides several global constant values for several
|
* SyslogConstants provides several global constant values for several
|
||||||
* classes within Syslog4j.
|
* classes within Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -2,7 +2,7 @@ package org.graylog2.syslog4j;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SyslogIF provides a common interface for all Syslog4j client implementations.
|
* SyslogIF provides a common interface for all Syslog4j client implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -14,39 +14,58 @@ public interface SyslogIF extends SyslogConstants {
|
|||||||
public void initialize(String protocol, SyslogConfigIF config) throws SyslogRuntimeException;
|
public void initialize(String protocol, SyslogConfigIF config) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public String getProtocol();
|
public String getProtocol();
|
||||||
|
|
||||||
public SyslogConfigIF getConfig();
|
public SyslogConfigIF getConfig();
|
||||||
|
|
||||||
public void backLog(int level, String message, Throwable reasonThrowable);
|
public void backLog(int level, String message, Throwable reasonThrowable);
|
||||||
|
|
||||||
public void backLog(int level, String message, String reason);
|
public void backLog(int level, String message, String reason);
|
||||||
|
|
||||||
public void log(int level, String message);
|
public void log(int level, String message);
|
||||||
|
|
||||||
public void debug(String message);
|
public void debug(String message);
|
||||||
|
|
||||||
public void info(String message);
|
public void info(String message);
|
||||||
|
|
||||||
public void notice(String message);
|
public void notice(String message);
|
||||||
|
|
||||||
public void warn(String message);
|
public void warn(String message);
|
||||||
|
|
||||||
public void error(String message);
|
public void error(String message);
|
||||||
|
|
||||||
public void critical(String message);
|
public void critical(String message);
|
||||||
|
|
||||||
public void alert(String message);
|
public void alert(String message);
|
||||||
|
|
||||||
public void emergency(String message);
|
public void emergency(String message);
|
||||||
|
|
||||||
public void log(int level, SyslogMessageIF message);
|
public void log(int level, SyslogMessageIF message);
|
||||||
|
|
||||||
public void debug(SyslogMessageIF message);
|
public void debug(SyslogMessageIF message);
|
||||||
|
|
||||||
public void info(SyslogMessageIF message);
|
public void info(SyslogMessageIF message);
|
||||||
|
|
||||||
public void notice(SyslogMessageIF message);
|
public void notice(SyslogMessageIF message);
|
||||||
|
|
||||||
public void warn(SyslogMessageIF message);
|
public void warn(SyslogMessageIF message);
|
||||||
|
|
||||||
public void error(SyslogMessageIF message);
|
public void error(SyslogMessageIF message);
|
||||||
|
|
||||||
public void critical(SyslogMessageIF message);
|
public void critical(SyslogMessageIF message);
|
||||||
|
|
||||||
public void alert(SyslogMessageIF message);
|
public void alert(SyslogMessageIF message);
|
||||||
|
|
||||||
public void emergency(SyslogMessageIF message);
|
public void emergency(SyslogMessageIF message);
|
||||||
|
|
||||||
public void flush() throws SyslogRuntimeException;
|
public void flush() throws SyslogRuntimeException;
|
||||||
|
|
||||||
public void shutdown() throws SyslogRuntimeException;
|
public void shutdown() throws SyslogRuntimeException;
|
||||||
|
|
||||||
public void setMessageProcessor(SyslogMessageProcessorIF messageProcessor);
|
public void setMessageProcessor(SyslogMessageProcessorIF messageProcessor);
|
||||||
|
|
||||||
public SyslogMessageProcessorIF getMessageProcessor();
|
public SyslogMessageProcessorIF getMessageProcessor();
|
||||||
|
|
||||||
public void setStructuredMessageProcessor(SyslogMessageProcessorIF messageProcessor);
|
public void setStructuredMessageProcessor(SyslogMessageProcessorIF messageProcessor);
|
||||||
|
|
||||||
public SyslogMessageProcessorIF getStructuredMessageProcessor();
|
public SyslogMessageProcessorIF getStructuredMessageProcessor();
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import java.io.InputStreamReader;
|
|||||||
/**
|
/**
|
||||||
* This class provides a command-line interface for Syslog4j
|
* This class provides a command-line interface for Syslog4j
|
||||||
* server implementations.
|
* server implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -80,13 +80,51 @@ public class SyslogMain {
|
|||||||
String arg = args[i++];
|
String arg = args[i++];
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
|
|
||||||
if ("-h".equals(arg)) { if (i == args.length) { options.usage = "Must specify host with -h"; return options; } match = true; options.host = args[i++]; }
|
if ("-h".equals(arg)) {
|
||||||
if ("-p".equals(arg)) { if (i == args.length) { options.usage = "Must specify port with -p"; return options; } match = true; options.port = args[i++]; }
|
if (i == args.length) {
|
||||||
if ("-l".equals(arg)) { if (i == args.length) { options.usage = "Must specify level with -l"; return options; } match = true; options.level = args[i++]; }
|
options.usage = "Must specify host with -h";
|
||||||
if ("-f".equals(arg)) { if (i == args.length) { options.usage = "Must specify facility with -f"; return options; } match = true; options.facility = args[i++]; }
|
return options;
|
||||||
if ("-i".equals(arg)) { if (i == args.length) { options.usage = "Must specify file with -i"; return options; } match = true; options.fileName = args[i++]; }
|
}
|
||||||
|
match = true;
|
||||||
|
options.host = args[i++];
|
||||||
|
}
|
||||||
|
if ("-p".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify port with -p";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.port = args[i++];
|
||||||
|
}
|
||||||
|
if ("-l".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify level with -l";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.level = args[i++];
|
||||||
|
}
|
||||||
|
if ("-f".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify facility with -f";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.facility = args[i++];
|
||||||
|
}
|
||||||
|
if ("-i".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify file with -i";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.fileName = args[i++];
|
||||||
|
}
|
||||||
|
|
||||||
if ("-q".equals(arg)) { match = true; options.quiet = true; }
|
if ("-q".equals(arg)) {
|
||||||
|
match = true;
|
||||||
|
options.quiet = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.protocol == null && !match) {
|
if (options.protocol == null && !match) {
|
||||||
match = true;
|
match = true;
|
||||||
@ -125,7 +163,11 @@ public class SyslogMain {
|
|||||||
|
|
||||||
if (options.usage != null) {
|
if (options.usage != null) {
|
||||||
usage(options.usage);
|
usage(options.usage);
|
||||||
if (CALL_SYSTEM_EXIT_ON_FAILURE) { System.exit(1); } else { return; }
|
if (CALL_SYSTEM_EXIT_ON_FAILURE) {
|
||||||
|
System.exit(1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options.quiet) {
|
if (!options.quiet) {
|
||||||
@ -134,7 +176,11 @@ public class SyslogMain {
|
|||||||
|
|
||||||
if (!Syslog.exists(options.protocol)) {
|
if (!Syslog.exists(options.protocol)) {
|
||||||
usage("Protocol \"" + options.protocol + "\" not supported");
|
usage("Protocol \"" + options.protocol + "\" not supported");
|
||||||
if (CALL_SYSTEM_EXIT_ON_FAILURE) { System.exit(1); } else { return; }
|
if (CALL_SYSTEM_EXIT_ON_FAILURE) {
|
||||||
|
System.exit(1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SyslogIF syslog = Syslog.getInstance(options.protocol);
|
SyslogIF syslog = Syslog.getInstance(options.protocol);
|
||||||
|
@ -4,7 +4,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SyslogMessageIF provides a common interface for all Syslog4j event implementations.
|
* SyslogMessageIF provides a common interface for all Syslog4j event implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -3,7 +3,7 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* SyslogMessageModifierConfigIF provides a common configuration interface for all
|
* SyslogMessageModifierConfigIF provides a common configuration interface for all
|
||||||
* Syslog4j message modifier implementations.
|
* Syslog4j message modifier implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -13,8 +13,10 @@ package org.graylog2.syslog4j;
|
|||||||
*/
|
*/
|
||||||
public interface SyslogMessageModifierConfigIF extends SyslogConstants, SyslogCharSetIF {
|
public interface SyslogMessageModifierConfigIF extends SyslogConstants, SyslogCharSetIF {
|
||||||
public String getPrefix();
|
public String getPrefix();
|
||||||
|
|
||||||
public void setPrefix(String prefix);
|
public void setPrefix(String prefix);
|
||||||
|
|
||||||
public String getSuffix();
|
public String getSuffix();
|
||||||
|
|
||||||
public void setSuffix(String suffix);
|
public void setSuffix(String suffix);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* SyslogMessageModifierIF provides a common interface for all
|
* SyslogMessageModifierIF provides a common interface for all
|
||||||
* Syslog4j message modifier implementations.
|
* Syslog4j message modifier implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -13,5 +13,6 @@ package org.graylog2.syslog4j;
|
|||||||
*/
|
*/
|
||||||
public interface SyslogMessageModifierIF extends SyslogConstants {
|
public interface SyslogMessageModifierIF extends SyslogConstants {
|
||||||
public String modify(SyslogIF syslog, int facility, int level, String message);
|
public String modify(SyslogIF syslog, int facility, int level, String message);
|
||||||
|
|
||||||
public boolean verify(String message);
|
public boolean verify(String message);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* SyslogMessageProcessorIF provides an extensible interface for writing custom
|
* SyslogMessageProcessorIF provides an extensible interface for writing custom
|
||||||
* Syslog4j message processors.
|
* Syslog4j message processors.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||||||
/**
|
/**
|
||||||
* SyslogPoolConfigIF is an interface which provides configuration support
|
* SyslogPoolConfigIF is an interface which provides configuration support
|
||||||
* for the Apache Commons Pool.
|
* for the Apache Commons Pool.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,38 +15,50 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public interface SyslogPoolConfigIF extends Serializable {
|
public interface SyslogPoolConfigIF extends Serializable {
|
||||||
public int getMaxActive();
|
public int getMaxActive();
|
||||||
|
|
||||||
public void setMaxActive(int maxActive);
|
public void setMaxActive(int maxActive);
|
||||||
|
|
||||||
public int getMaxIdle();
|
public int getMaxIdle();
|
||||||
|
|
||||||
public void setMaxIdle(int maxIdle);
|
public void setMaxIdle(int maxIdle);
|
||||||
|
|
||||||
public long getMaxWait();
|
public long getMaxWait();
|
||||||
|
|
||||||
public void setMaxWait(long maxWait);
|
public void setMaxWait(long maxWait);
|
||||||
|
|
||||||
public long getMinEvictableIdleTimeMillis();
|
public long getMinEvictableIdleTimeMillis();
|
||||||
|
|
||||||
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis);
|
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis);
|
||||||
|
|
||||||
public int getMinIdle();
|
public int getMinIdle();
|
||||||
|
|
||||||
public void setMinIdle(int minIdle);
|
public void setMinIdle(int minIdle);
|
||||||
|
|
||||||
public int getNumTestsPerEvictionRun();
|
public int getNumTestsPerEvictionRun();
|
||||||
|
|
||||||
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun);
|
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun);
|
||||||
|
|
||||||
public long getSoftMinEvictableIdleTimeMillis();
|
public long getSoftMinEvictableIdleTimeMillis();
|
||||||
|
|
||||||
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis);
|
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis);
|
||||||
|
|
||||||
public boolean isTestOnBorrow();
|
public boolean isTestOnBorrow();
|
||||||
|
|
||||||
public void setTestOnBorrow(boolean testOnBorrow);
|
public void setTestOnBorrow(boolean testOnBorrow);
|
||||||
|
|
||||||
public boolean isTestOnReturn();
|
public boolean isTestOnReturn();
|
||||||
|
|
||||||
public void setTestOnReturn(boolean testOnReturn);
|
public void setTestOnReturn(boolean testOnReturn);
|
||||||
|
|
||||||
public boolean isTestWhileIdle();
|
public boolean isTestWhileIdle();
|
||||||
|
|
||||||
public void setTestWhileIdle(boolean testWhileIdle);
|
public void setTestWhileIdle(boolean testWhileIdle);
|
||||||
|
|
||||||
public long getTimeBetweenEvictionRunsMillis();
|
public long getTimeBetweenEvictionRunsMillis();
|
||||||
|
|
||||||
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis);
|
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis);
|
||||||
|
|
||||||
public byte getWhenExhaustedAction();
|
public byte getWhenExhaustedAction();
|
||||||
|
|
||||||
public void setWhenExhaustedAction(byte whenExhaustedAction);
|
public void setWhenExhaustedAction(byte whenExhaustedAction);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package org.graylog2.syslog4j;
|
|||||||
/**
|
/**
|
||||||
* SyslogRuntimeException provides an extension of RuntimeException thrown
|
* SyslogRuntimeException provides an extension of RuntimeException thrown
|
||||||
* by the majority of the classes within Syslog4j.
|
* by the majority of the classes within Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -18,7 +18,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractSyslog provides a base abstract implementation of the SyslogIF.
|
* AbstractSyslog provides a base abstract implementation of the SyslogIF.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -12,7 +12,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslog provides a base abstract implementation of the SyslogConfigIF
|
* AbstractSyslog provides a base abstract implementation of the SyslogConfigIF
|
||||||
* configuration interface.
|
* configuration interface.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.SyslogConfigIF;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogConfigIF provides an interface for all Abstract Syslog
|
* AbstractSyslogConfigIF provides an interface for all Abstract Syslog
|
||||||
* configuration implementations.
|
* configuration implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -23,30 +23,39 @@ public interface AbstractSyslogConfigIF extends SyslogConfigIF {
|
|||||||
public List getMessageModifiers();
|
public List getMessageModifiers();
|
||||||
|
|
||||||
public byte[] getSplitMessageBeginText();
|
public byte[] getSplitMessageBeginText();
|
||||||
|
|
||||||
public void setSplitMessageBeginText(byte[] beginText);
|
public void setSplitMessageBeginText(byte[] beginText);
|
||||||
|
|
||||||
public byte[] getSplitMessageEndText();
|
public byte[] getSplitMessageEndText();
|
||||||
|
|
||||||
public void setSplitMessageEndText(byte[] endText);
|
public void setSplitMessageEndText(byte[] endText);
|
||||||
|
|
||||||
public boolean isThreaded();
|
public boolean isThreaded();
|
||||||
|
|
||||||
public void setThreaded(boolean threaded);
|
public void setThreaded(boolean threaded);
|
||||||
|
|
||||||
public boolean isUseDaemonThread();
|
public boolean isUseDaemonThread();
|
||||||
|
|
||||||
public void setUseDaemonThread(boolean useDaemonThread);
|
public void setUseDaemonThread(boolean useDaemonThread);
|
||||||
|
|
||||||
public int getThreadPriority();
|
public int getThreadPriority();
|
||||||
|
|
||||||
public void setThreadPriority(int threadPriority);
|
public void setThreadPriority(int threadPriority);
|
||||||
|
|
||||||
public long getThreadLoopInterval();
|
public long getThreadLoopInterval();
|
||||||
|
|
||||||
public void setThreadLoopInterval(long threadLoopInterval);
|
public void setThreadLoopInterval(long threadLoopInterval);
|
||||||
|
|
||||||
public long getMaxShutdownWait();
|
public long getMaxShutdownWait();
|
||||||
|
|
||||||
public void setMaxShutdownWait(long maxShutdownWait);
|
public void setMaxShutdownWait(long maxShutdownWait);
|
||||||
|
|
||||||
public int getWriteRetries();
|
public int getWriteRetries();
|
||||||
|
|
||||||
public void setWriteRetries(int writeRetries);
|
public void setWriteRetries(int writeRetries);
|
||||||
|
|
||||||
public int getMaxQueueSize();
|
public int getMaxQueueSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the (default) value of -1 to allow for a queue of indefinite depth (size).
|
* Use the (default) value of -1 to allow for a queue of indefinite depth (size).
|
||||||
*
|
*
|
||||||
|
@ -11,10 +11,10 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogWriter is an implementation of Runnable that supports sending
|
* AbstractSyslogWriter is an implementation of Runnable that supports sending
|
||||||
* syslog messages within a separate Thread or an object pool.
|
* syslog messages within a separate Thread or an object pool.
|
||||||
*
|
* <p/>
|
||||||
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
||||||
* a queuing mechanism is used (via LinkedList).</p>
|
* a queuing mechanism is used (via LinkedList).</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
* AbstractSyslogBackLogHandler is an implementation of SyslogBackLogHandlerIF
|
* AbstractSyslogBackLogHandler is an implementation of SyslogBackLogHandlerIF
|
||||||
* that mainly provides the helpful "combine" method for handling the "reason"
|
* that mainly provides the helpful "combine" method for handling the "reason"
|
||||||
* why a BackLog has occurred.
|
* why a BackLog has occurred.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.SyslogIF;
|
|||||||
/**
|
/**
|
||||||
* NullSyslogBackLogHandler can be used if there's no need for a last-chance
|
* NullSyslogBackLogHandler can be used if there's no need for a last-chance
|
||||||
* logging mechanism whenever the Syslog protocol fails.
|
* logging mechanism whenever the Syslog protocol fails.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
/**
|
/**
|
||||||
* Syslog4jBackLogHandler is used to send Syslog backLog messages to
|
* Syslog4jBackLogHandler is used to send Syslog backLog messages to
|
||||||
* another Syslog4j protocol whenever the main Syslog protocol fails.
|
* another Syslog4j protocol whenever the main Syslog protocol fails.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -11,7 +11,7 @@ import org.graylog2.syslog4j.impl.backlog.AbstractSyslogBackLogHandler;
|
|||||||
/**
|
/**
|
||||||
* Log4jSyslogBackLogHandler is used to send Syslog backLog messages to
|
* Log4jSyslogBackLogHandler is used to send Syslog backLog messages to
|
||||||
* Log4j whenever the Syslog protocol fails.
|
* Log4j whenever the Syslog protocol fails.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -116,14 +116,22 @@ public class Log4jSyslogBackLogHandler extends AbstractSyslogBackLogHandler {
|
|||||||
|
|
||||||
protected static Level getLog4jLevel(int level) {
|
protected static Level getLog4jLevel(int level) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case SyslogConstants.LEVEL_DEBUG: return Level.DEBUG;
|
case SyslogConstants.LEVEL_DEBUG:
|
||||||
case SyslogConstants.LEVEL_INFO: return Level.INFO;
|
return Level.DEBUG;
|
||||||
case SyslogConstants.LEVEL_NOTICE: return Level.INFO;
|
case SyslogConstants.LEVEL_INFO:
|
||||||
case SyslogConstants.LEVEL_WARN: return Level.WARN;
|
return Level.INFO;
|
||||||
case SyslogConstants.LEVEL_ERROR: return Level.ERROR;
|
case SyslogConstants.LEVEL_NOTICE:
|
||||||
case SyslogConstants.LEVEL_CRITICAL: return Level.ERROR;
|
return Level.INFO;
|
||||||
case SyslogConstants.LEVEL_ALERT: return Level.ERROR;
|
case SyslogConstants.LEVEL_WARN:
|
||||||
case SyslogConstants.LEVEL_EMERGENCY: return Level.FATAL;
|
return Level.WARN;
|
||||||
|
case SyslogConstants.LEVEL_ERROR:
|
||||||
|
return Level.ERROR;
|
||||||
|
case SyslogConstants.LEVEL_CRITICAL:
|
||||||
|
return Level.ERROR;
|
||||||
|
case SyslogConstants.LEVEL_ALERT:
|
||||||
|
return Level.ERROR;
|
||||||
|
case SyslogConstants.LEVEL_EMERGENCY:
|
||||||
|
return Level.FATAL;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return Level.WARN;
|
return Level.WARN;
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.impl.backlog.AbstractSyslogBackLogHandler;
|
|||||||
/**
|
/**
|
||||||
* PrintStreamSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
* PrintStreamSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
||||||
* (for whatever reason) within the rest of Syslog to a PrintStream.
|
* (for whatever reason) within the rest of Syslog to a PrintStream.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.SyslogBackLogHandlerIF;
|
|||||||
/**
|
/**
|
||||||
* SystemErrSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
* SystemErrSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
||||||
* (for whatever reason) within the rest of Syslog to System.err.
|
* (for whatever reason) within the rest of Syslog to System.err.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -21,6 +21,7 @@ public class SystemErrSyslogBackLogHandler extends PrintStreamSyslogBackLogHandl
|
|||||||
public SystemErrSyslogBackLogHandler() {
|
public SystemErrSyslogBackLogHandler() {
|
||||||
super(System.err, true);
|
super(System.err, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemErrSyslogBackLogHandler(boolean appendReason) {
|
public SystemErrSyslogBackLogHandler(boolean appendReason) {
|
||||||
super(System.err, true, appendReason);
|
super(System.err, true, appendReason);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.SyslogBackLogHandlerIF;
|
|||||||
/**
|
/**
|
||||||
* SystemOutSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
* SystemOutSyslogBackLogHandler provides a last-chance mechanism to log messages that fail
|
||||||
* (for whatever reason) within the rest of Syslog to System.out.
|
* (for whatever reason) within the rest of Syslog to System.out.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -21,6 +21,7 @@ public class SystemOutSyslogBackLogHandler extends PrintStreamSyslogBackLogHandl
|
|||||||
public SystemOutSyslogBackLogHandler() {
|
public SystemOutSyslogBackLogHandler() {
|
||||||
super(System.out, true);
|
super(System.out, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemOutSyslogBackLogHandler(boolean appendReason) {
|
public SystemOutSyslogBackLogHandler(boolean appendReason) {
|
||||||
super(System.out, true, appendReason);
|
super(System.out, true, appendReason);
|
||||||
}
|
}
|
||||||
|
@ -4,26 +4,26 @@ import org.apache.log4j.helpers.LogLog;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslog4jAppender provides a Log4j Appender wrapper for Syslog4j.
|
* Syslog4jAppender provides a Log4j Appender wrapper for Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Note: Syslog4jAppender does NOT extend Log4j's SyslogAppender.</p>
|
* <p>Note: Syslog4jAppender does NOT extend Log4j's SyslogAppender.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Example log4j.xml configuration:</p>
|
* <p>Example log4j.xml configuration:</p>
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <code>
|
* <code>
|
||||||
<appender name="Syslog4j" class="org.graylog2.syslog4j.impl.log4j.Syslog4jAppender">
|
* <appender name="Syslog4j" class="org.graylog2.syslog4j.impl.log4j.Syslog4jAppender">
|
||||||
<param name="Facility" value="user"/>
|
* <param name="Facility" value="user"/>
|
||||||
<param name="Protocol" value="tcp"/>
|
* <param name="Protocol" value="tcp"/>
|
||||||
<param name="Host" value="192.168.0.1"/>
|
* <param name="Host" value="192.168.0.1"/>
|
||||||
<layout class="org.apache.log4j.PatternLayout">
|
* <layout class="org.apache.log4j.PatternLayout">
|
||||||
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m"/>
|
* <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m"/>
|
||||||
</layout>
|
* </layout>
|
||||||
</appender>
|
* </appender>
|
||||||
* </code>
|
* </code>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p/>
|
||||||
* <p>All available parameters are:</p>
|
* <p>All available parameters are:</p>
|
||||||
*
|
* <p/>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>ident</li>
|
* <li>ident</li>
|
||||||
* <li>localName</li>
|
* <li>localName</li>
|
||||||
@ -42,7 +42,7 @@ import org.apache.log4j.helpers.LogLog;
|
|||||||
* <li>truncateMessage</li>
|
* <li>truncateMessage</li>
|
||||||
* <li>useStructuredData</li>
|
* <li>useStructuredData</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -12,10 +12,10 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslog4jAppenderSkeleton provides an extensible Log4j Appender wrapper for Syslog4j.
|
* Syslog4jAppenderSkeleton provides an extensible Log4j Appender wrapper for Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Classes which inherit Syslog4jAppenderSkeleton must implement the "initialize()" method,
|
* <p>Classes which inherit Syslog4jAppenderSkeleton must implement the "initialize()" method,
|
||||||
* which sets up Syslog4j for use by the Log4j Appender.</p>
|
* which sets up Syslog4j for use by the Log4j Appender.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -10,11 +10,11 @@ import org.graylog2.syslog4j.SyslogMessageIF;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogMessage provides support for turning POJO (Plain Ol'
|
* AbstractSyslogMessage provides support for turning POJO (Plain Ol'
|
||||||
* Java Objects) into Syslog messages.
|
* Java Objects) into Syslog messages.
|
||||||
*
|
* <p/>
|
||||||
* <p>More information on the PCI DSS specification is available here:</p>
|
* <p>More information on the PCI DSS specification is available here:</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.SyslogMessageModifierConfigIF;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogMessageModifierConfig provides a base abstract implementation of the
|
* AbstractSyslogMessageModifierConfig provides a base abstract implementation of the
|
||||||
* SyslogMessageModifierConfigIF.
|
* SyslogMessageModifierConfigIF.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* ChecksumSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* ChecksumSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for Java Checksum algorithms (java.util.zip.Checksum).
|
* that provides support for Java Checksum algorithms (java.util.zip.Checksum).
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -26,6 +26,7 @@ public class ChecksumSyslogMessageModifier extends AbstractSyslogMessageModifier
|
|||||||
|
|
||||||
return crc32;
|
return crc32;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final ChecksumSyslogMessageModifier createADLER32() {
|
public static final ChecksumSyslogMessageModifier createADLER32() {
|
||||||
ChecksumSyslogMessageModifier adler32 = new ChecksumSyslogMessageModifier(ChecksumSyslogMessageModifierConfig.createADLER32());
|
ChecksumSyslogMessageModifier adler32 = new ChecksumSyslogMessageModifier(ChecksumSyslogMessageModifierConfig.createADLER32());
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.impl.message.modifier.AbstractSyslogMessageModifier
|
|||||||
/**
|
/**
|
||||||
* ChecksumSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
* ChecksumSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
||||||
* that provides configuration for ChecksumSyslogMessageModifier.
|
* that provides configuration for ChecksumSyslogMessageModifier.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,10 +6,10 @@ import org.graylog2.syslog4j.SyslogMessageModifierIF;
|
|||||||
/**
|
/**
|
||||||
* HTMLEntityEscapeSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* HTMLEntityEscapeSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that safely escapes HTML entity characters.
|
* that safely escapes HTML entity characters.
|
||||||
*
|
* <p/>
|
||||||
* <p>This modifier is useful for applications that display log content in browsers without
|
* <p>This modifier is useful for applications that display log content in browsers without
|
||||||
* properly escaping HTML characters.</p>
|
* properly escaping HTML characters.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -13,7 +13,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* HashSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* HashSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for Java Cryptographic hashes (MD5, SHA1, SHA256, etc.).
|
* that provides support for Java Cryptographic hashes (MD5, SHA1, SHA256, etc.).
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.message.modifier.AbstractSyslogMessageModifier
|
|||||||
/**
|
/**
|
||||||
* HashSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
* HashSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
||||||
* that provides configuration for HashSyslogMessageModifier.
|
* that provides configuration for HashSyslogMessageModifier.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -16,7 +16,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* MacSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* MacSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for Java Cryptographic signed hashes (HmacSHA1, etc.)
|
* that provides support for Java Cryptographic signed hashes (HmacSHA1, etc.)
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -11,7 +11,7 @@ import org.graylog2.syslog4j.util.Base64;
|
|||||||
/**
|
/**
|
||||||
* MacSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
* MacSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
||||||
* that provides configuration for HashSyslogMessageModifier.
|
* that provides configuration for HashSyslogMessageModifier.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.SyslogMessageModifierIF;
|
|||||||
/**
|
/**
|
||||||
* SequentialSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* SequentialSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that adds an incremented number at the end.
|
* that adds an incremented number at the end.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.message.modifier.AbstractSyslogMessageModifier
|
|||||||
/**
|
/**
|
||||||
* SequentialSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
* SequentialSyslogMessageModifierConfig is an implementation of AbstractSyslogMessageModifierConfig
|
||||||
* that provides configuration for SequentialSyslogMessageModifier.
|
* that provides configuration for SequentialSyslogMessageModifier.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.SyslogMessageModifierIF;
|
|||||||
/**
|
/**
|
||||||
* PrefixSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* PrefixSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for adding static text to the beginning of a Syslog message.
|
* that provides support for adding static text to the beginning of a Syslog message.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
* StringCaseSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* StringCaseSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for shifting a Syslog message to all upper case or all
|
* that provides support for shifting a Syslog message to all upper case or all
|
||||||
* lower case.
|
* lower case.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.SyslogMessageModifierIF;
|
|||||||
/**
|
/**
|
||||||
* SuffixSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
* SuffixSyslogMessageModifier is an implementation of SyslogMessageModifierIF
|
||||||
* that provides support for adding static text to the end of a Syslog message.
|
* that provides support for adding static text to the end of a Syslog message.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,14 +8,14 @@ import org.graylog2.syslog4j.impl.message.AbstractSyslogMessage;
|
|||||||
/**
|
/**
|
||||||
* PCISyslogMessage provides support for audit trails defined by section
|
* PCISyslogMessage provides support for audit trails defined by section
|
||||||
* 10.3 of the PCI Data Security Standard (PCI DSS) versions 1.1 and 1.2.
|
* 10.3 of the PCI Data Security Standard (PCI DSS) versions 1.1 and 1.2.
|
||||||
*
|
* <p/>
|
||||||
* <p>More information on the PCI DSS specification is available here:</p>
|
* <p>More information on the PCI DSS specification is available here:</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>The PCI DSS specification is Copyright 2008 PCI Security Standards
|
* <p>The PCI DSS specification is Copyright 2008 PCI Security Standards
|
||||||
* Council LLC.</p>
|
* Council LLC.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -65,14 +65,38 @@ public class PCISyslogMessage extends AbstractSyslogMessage implements PCISyslog
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void init(Map fields) {
|
protected void init(Map fields) {
|
||||||
if (fields.containsKey(USER_ID)) { this.userId = (String) fields.get(USER_ID); };
|
if (fields.containsKey(USER_ID)) {
|
||||||
if (fields.containsKey(EVENT_TYPE)) { this.eventType = (String) fields.get(EVENT_TYPE); };
|
this.userId = (String) fields.get(USER_ID);
|
||||||
if (fields.containsKey(DATE) && fields.get(DATE) instanceof String) { this.date = (String) fields.get(DATE); };
|
}
|
||||||
if (fields.containsKey(DATE) && fields.get(DATE) instanceof Date) { setDate((Date) fields.get(DATE)); };
|
;
|
||||||
if (fields.containsKey(TIME)) { this.time = (String) fields.get(TIME); };
|
if (fields.containsKey(EVENT_TYPE)) {
|
||||||
if (fields.containsKey(STATUS)) { this.status = (String) fields.get(STATUS); };
|
this.eventType = (String) fields.get(EVENT_TYPE);
|
||||||
if (fields.containsKey(ORIGINATION)) { this.origination = (String) fields.get(ORIGINATION); };
|
}
|
||||||
if (fields.containsKey(AFFECTED_RESOURCE)) { this.affectedResource = (String) fields.get(AFFECTED_RESOURCE); };
|
;
|
||||||
|
if (fields.containsKey(DATE) && fields.get(DATE) instanceof String) {
|
||||||
|
this.date = (String) fields.get(DATE);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (fields.containsKey(DATE) && fields.get(DATE) instanceof Date) {
|
||||||
|
setDate((Date) fields.get(DATE));
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (fields.containsKey(TIME)) {
|
||||||
|
this.time = (String) fields.get(TIME);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (fields.containsKey(STATUS)) {
|
||||||
|
this.status = (String) fields.get(STATUS);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (fields.containsKey(ORIGINATION)) {
|
||||||
|
this.origination = (String) fields.get(ORIGINATION);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (fields.containsKey(AFFECTED_RESOURCE)) {
|
||||||
|
this.affectedResource = (String) fields.get(AFFECTED_RESOURCE);
|
||||||
|
}
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PCISyslogMessage(String userId, String eventType, String status, String affectedResource) {
|
public PCISyslogMessage(String userId, String eventType, String status, String affectedResource) {
|
||||||
|
@ -4,14 +4,14 @@ package org.graylog2.syslog4j.impl.message.pci;
|
|||||||
* PCISyslogMessageIF provides a definition of the fields for audit trails
|
* PCISyslogMessageIF provides a definition of the fields for audit trails
|
||||||
* defined by section 10.3 of the PCI Data Security Standard (PCI DSS)
|
* defined by section 10.3 of the PCI Data Security Standard (PCI DSS)
|
||||||
* versions 1.1 and 1.2.
|
* versions 1.1 and 1.2.
|
||||||
*
|
* <p/>
|
||||||
* <p>More information on the PCI DSS specification is available here:</p>
|
* <p>More information on the PCI DSS specification is available here:</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
* <p>https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>The PCI DSS specification is Copyright 2008 PCI Security Standards
|
* <p>The PCI DSS specification is Copyright 2008 PCI Security Standards
|
||||||
* Council LLC.</p>
|
* Council LLC.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -21,10 +21,16 @@ package org.graylog2.syslog4j.impl.message.pci;
|
|||||||
*/
|
*/
|
||||||
public interface PCISyslogMessageIF {
|
public interface PCISyslogMessageIF {
|
||||||
public String getUserId();
|
public String getUserId();
|
||||||
|
|
||||||
public String getEventType();
|
public String getEventType();
|
||||||
|
|
||||||
public String getDate();
|
public String getDate();
|
||||||
|
|
||||||
public String getTime();
|
public String getTime();
|
||||||
|
|
||||||
public String getStatus();
|
public String getStatus();
|
||||||
|
|
||||||
public String getOrigination();
|
public String getOrigination();
|
||||||
|
|
||||||
public String getAffectedResource();
|
public String getAffectedResource();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
* AbstractSyslogMessageProcessor provides the ability to split a syslog message
|
* AbstractSyslogMessageProcessor provides the ability to split a syslog message
|
||||||
* into multiple messages when the message is greater than the syslog
|
* into multiple messages when the message is greater than the syslog
|
||||||
* maximum message length (1024 bytes including the header).
|
* maximum message length (1024 bytes including the header).
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -3,12 +3,12 @@ package org.graylog2.syslog4j.impl.message.processor;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SyslogMessageProcessor wraps AbstractSyslogMessageProcessor.
|
* SyslogMessageProcessor wraps AbstractSyslogMessageProcessor.
|
||||||
*
|
* <p/>
|
||||||
* <p>Those wishing to replace (or improve upon) this implementation
|
* <p>Those wishing to replace (or improve upon) this implementation
|
||||||
* can write a custom SyslogMessageProcessorIF and set it per
|
* can write a custom SyslogMessageProcessorIF and set it per
|
||||||
* instance via the SyslogIF.setMessageProcessor(..) method or set it globally
|
* instance via the SyslogIF.setMessageProcessor(..) method or set it globally
|
||||||
* via the SyslogMessageProcessor.setDefault(..) method.</p>
|
* via the SyslogMessageProcessor.setDefault(..) method.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -11,14 +11,14 @@ import org.graylog2.syslog4j.impl.message.structured.StructuredSyslogMessage;
|
|||||||
* than the syslog maximum message length (1024 bytes including the header). It
|
* than the syslog maximum message length (1024 bytes including the header). It
|
||||||
* adds support for structured syslog messages as specified by
|
* adds support for structured syslog messages as specified by
|
||||||
* draft-ietf-syslog-protocol-23. More information here:
|
* draft-ietf-syslog-protocol-23. More information here:
|
||||||
*
|
* <p/>
|
||||||
* <p>http://tools.ietf.org/html/draft-ietf-syslog-protocol-23</p>
|
* <p>http://tools.ietf.org/html/draft-ietf-syslog-protocol-23</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Those wishing to replace (or improve upon) this implementation
|
* <p>Those wishing to replace (or improve upon) this implementation
|
||||||
* can write a custom SyslogMessageProcessorIF and set it per
|
* can write a custom SyslogMessageProcessorIF and set it per
|
||||||
* instance via the SyslogIF.setStructuredMessageProcessor(..) method or set it globally
|
* instance via the SyslogIF.setStructuredMessageProcessor(..) method or set it globally
|
||||||
* via the StructuredSyslogMessageProcessor.setDefault(..) method.</p>
|
* via the StructuredSyslogMessageProcessor.setDefault(..) method.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
||||||
* LGPL license is available in the META-INF folder in all distributions of
|
* LGPL license is available in the META-INF folder in all distributions of
|
||||||
|
@ -13,11 +13,11 @@ import org.graylog2.syslog4j.impl.message.AbstractSyslogMessage;
|
|||||||
* support for turning POJO (Plain Ol' Java Objects) into Syslog messages. It
|
* support for turning POJO (Plain Ol' Java Objects) into Syslog messages. It
|
||||||
* adds support for structured syslog messages as specified by
|
* adds support for structured syslog messages as specified by
|
||||||
* draft-ietf-syslog-protocol-23. More information here:
|
* draft-ietf-syslog-protocol-23. More information here:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
||||||
* LGPL license is available in the META-INF folder in all distributions of
|
* LGPL license is available in the META-INF folder in all distributions of
|
||||||
@ -43,11 +43,11 @@ public class StructuredSyslogMessage extends AbstractSyslogMessage implements St
|
|||||||
/**
|
/**
|
||||||
* Constructs the {@link StructuredSyslogMessage} using MSGID,
|
* Constructs the {@link StructuredSyslogMessage} using MSGID,
|
||||||
* STRUCTURED-DATA and MSG fields, as described in:
|
* STRUCTURED-DATA and MSG fields, as described in:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* The Map must be a String -> (Map of String -> String), which encompasses
|
* The Map must be a String -> (Map of String -> String), which encompasses
|
||||||
* the STRUCTURED-DATA field described in above document.
|
* the STRUCTURED-DATA field described in above document.
|
||||||
*
|
*
|
||||||
@ -194,7 +194,7 @@ public class StructuredSyslogMessage extends AbstractSyslogMessage implements St
|
|||||||
/**
|
/**
|
||||||
* Returns the MSGID field of the structured message format, as described
|
* Returns the MSGID field of the structured message format, as described
|
||||||
* in:
|
* in:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
@ -208,7 +208,7 @@ public class StructuredSyslogMessage extends AbstractSyslogMessage implements St
|
|||||||
/**
|
/**
|
||||||
* Returns the structured data map. The Map is a String -> (Map of String ->
|
* Returns the structured data map. The Map is a String -> (Map of String ->
|
||||||
* String), which encompasses the STRUCTURED-DATA field, as described in:
|
* String), which encompasses the STRUCTURED-DATA field, as described in:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
@ -221,7 +221,7 @@ public class StructuredSyslogMessage extends AbstractSyslogMessage implements St
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the MSG field of the structured message format, as described in:
|
* Returns the MSG field of the structured message format, as described in:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.SyslogMessageIF;
|
|||||||
/**
|
/**
|
||||||
* StructuredSyslogMessageIF is a "marker" interface to identify structured
|
* StructuredSyslogMessageIF is a "marker" interface to identify structured
|
||||||
* SyslogMessageIF implementations.
|
* SyslogMessageIF implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -11,7 +11,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
/**
|
/**
|
||||||
* MultipleSyslog is an aggregator Syslog implementation for allowing a single
|
* MultipleSyslog is an aggregator Syslog implementation for allowing a single
|
||||||
* Syslog call to send to multiple Syslog implementations.
|
* Syslog call to send to multiple Syslog implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -12,7 +12,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
/**
|
/**
|
||||||
* MultipleSyslogConfig is a configuration Object for allowing a single
|
* MultipleSyslogConfig is a configuration Object for allowing a single
|
||||||
* Syslog call to send to multiple Syslog implementations.
|
* Syslog call to send to multiple Syslog implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* AbstractNetSyslog is an abstract extension of AbstractSyslog
|
* AbstractNetSyslog is an abstract extension of AbstractSyslog
|
||||||
* that provides support for network-based syslog clients.
|
* that provides support for network-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.AbstractSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* AbstractNetSyslogConfig is an abstract extension of AbstractSyslogConfig
|
* AbstractNetSyslogConfig is an abstract extension of AbstractSyslogConfig
|
||||||
* that provides configuration support for network-based syslog clients.
|
* that provides configuration support for network-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.AbstractSyslogConfigIF;
|
|||||||
/**
|
/**
|
||||||
* AbstractNetSyslogConfigIF is a configuration interface supporting network-based
|
* AbstractNetSyslogConfigIF is a configuration interface supporting network-based
|
||||||
* Syslog implementations.
|
* Syslog implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,5 +15,6 @@ import org.graylog2.syslog4j.impl.AbstractSyslogConfigIF;
|
|||||||
*/
|
*/
|
||||||
public interface AbstractNetSyslogConfigIF extends AbstractSyslogConfigIF {
|
public interface AbstractNetSyslogConfigIF extends AbstractSyslogConfigIF {
|
||||||
public boolean isCacheHostAddress();
|
public boolean isCacheHostAddress();
|
||||||
|
|
||||||
public void setCacheHostAddress(boolean cacheHostAddress);
|
public void setCacheHostAddress(boolean cacheHostAddress);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.impl.net.AbstractNetSyslog;
|
|||||||
/**
|
/**
|
||||||
* TCPNetSyslog is an extension of AbstractSyslog that provides support for
|
* TCPNetSyslog is an extension of AbstractSyslog that provides support for
|
||||||
* TCP/IP-based syslog clients.
|
* TCP/IP-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* TCPNetSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
* TCPNetSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
||||||
* configuration support for TCP/IP-based syslog clients.
|
* configuration support for TCP/IP-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.net.AbstractNetSyslogConfigIF;
|
|||||||
/**
|
/**
|
||||||
* TCPNetSyslogConfigIF is a configuration interface supporting TCP/IP-based
|
* TCPNetSyslogConfigIF is a configuration interface supporting TCP/IP-based
|
||||||
* Syslog implementations.
|
* Syslog implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,26 +15,34 @@ import org.graylog2.syslog4j.impl.net.AbstractNetSyslogConfigIF;
|
|||||||
*/
|
*/
|
||||||
public interface TCPNetSyslogConfigIF extends AbstractNetSyslogConfigIF {
|
public interface TCPNetSyslogConfigIF extends AbstractNetSyslogConfigIF {
|
||||||
public byte[] getDelimiterSequence();
|
public byte[] getDelimiterSequence();
|
||||||
|
|
||||||
public void setDelimiterSequence(byte[] delimiterSequence);
|
public void setDelimiterSequence(byte[] delimiterSequence);
|
||||||
|
|
||||||
public boolean isPersistentConnection();
|
public boolean isPersistentConnection();
|
||||||
|
|
||||||
public void setPersistentConnection(boolean persistentConnection);
|
public void setPersistentConnection(boolean persistentConnection);
|
||||||
|
|
||||||
public boolean isSoLinger();
|
public boolean isSoLinger();
|
||||||
|
|
||||||
public void setSoLinger(boolean soLinger);
|
public void setSoLinger(boolean soLinger);
|
||||||
|
|
||||||
public int getSoLingerSeconds();
|
public int getSoLingerSeconds();
|
||||||
|
|
||||||
public void setSoLingerSeconds(int soLingerSeconds);
|
public void setSoLingerSeconds(int soLingerSeconds);
|
||||||
|
|
||||||
public boolean isKeepAlive();
|
public boolean isKeepAlive();
|
||||||
|
|
||||||
public void setKeepAlive(boolean keepAlive);
|
public void setKeepAlive(boolean keepAlive);
|
||||||
|
|
||||||
public boolean isReuseAddress();
|
public boolean isReuseAddress();
|
||||||
|
|
||||||
public void setReuseAddress(boolean reuseAddress);
|
public void setReuseAddress(boolean reuseAddress);
|
||||||
|
|
||||||
public boolean isSetBufferSize();
|
public boolean isSetBufferSize();
|
||||||
|
|
||||||
public void setSetBufferSize(boolean setBufferSize);
|
public void setSetBufferSize(boolean setBufferSize);
|
||||||
|
|
||||||
public int getFreshConnectionInterval();
|
public int getFreshConnectionInterval();
|
||||||
|
|
||||||
public void setFreshConnectionInterval(int interval);
|
public void setFreshConnectionInterval(int interval);
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,10 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* TCPNetSyslogWriter is an implementation of Runnable that supports sending
|
* TCPNetSyslogWriter is an implementation of Runnable that supports sending
|
||||||
* TCP-based messages within a separate Thread.
|
* TCP-based messages within a separate Thread.
|
||||||
*
|
* <p/>
|
||||||
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
||||||
* a queuing mechanism is used (via LinkedList).</p>
|
* a queuing mechanism is used (via LinkedList).</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.impl.pool.generic.GenericSyslogPoolFactory;
|
|||||||
/**
|
/**
|
||||||
* PooledTCPNetSyslog is an extension of TCPNetSyslog which provides support
|
* PooledTCPNetSyslog is an extension of TCPNetSyslog which provides support
|
||||||
* for Apache Commons Pool.
|
* for Apache Commons Pool.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* NetSyslogPoolFactory is an implementation of SyslogPoolConfigIF
|
* NetSyslogPoolFactory is an implementation of SyslogPoolConfigIF
|
||||||
* which provides configuration support for the Apache Commons Pool.
|
* which provides configuration support for the Apache Commons Pool.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslog;
|
|||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslog is an extension of AbstractSyslog that provides support for
|
* SSLTCPNetSyslog is an extension of AbstractSyslog that provides support for
|
||||||
* TCP/IP-based (over SSL/TLS) syslog clients.
|
* TCP/IP-based (over SSL/TLS) syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogConfig is an extension of TCPNetSyslogConfig that provides
|
* SSLTCPNetSyslogConfig is an extension of TCPNetSyslogConfig that provides
|
||||||
* configuration support for TCP/IP-based (over SSL/TLS) syslog clients.
|
* configuration support for TCP/IP-based (over SSL/TLS) syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslogConfigIF;
|
|||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogConfigIF is a configuration interface supporting TCP/IP-based
|
* SSLTCPNetSyslogConfigIF is a configuration interface supporting TCP/IP-based
|
||||||
* (over SSL/TLS) Syslog implementations.
|
* (over SSL/TLS) Syslog implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -15,14 +15,18 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslogConfigIF;
|
|||||||
*/
|
*/
|
||||||
public interface SSLTCPNetSyslogConfigIF extends TCPNetSyslogConfigIF {
|
public interface SSLTCPNetSyslogConfigIF extends TCPNetSyslogConfigIF {
|
||||||
public String getKeyStore();
|
public String getKeyStore();
|
||||||
|
|
||||||
public void setKeyStore(String keyStore);
|
public void setKeyStore(String keyStore);
|
||||||
|
|
||||||
public String getKeyStorePassword();
|
public String getKeyStorePassword();
|
||||||
|
|
||||||
public void setKeyStorePassword(String keyStorePassword);
|
public void setKeyStorePassword(String keyStorePassword);
|
||||||
|
|
||||||
public String getTrustStore();
|
public String getTrustStore();
|
||||||
|
|
||||||
public void setTrustStore(String trustStore);
|
public void setTrustStore(String trustStore);
|
||||||
|
|
||||||
public String getTrustStorePassword();
|
public String getTrustStorePassword();
|
||||||
|
|
||||||
public void setTrustStorePassword(String trustStorePassword);
|
public void setTrustStorePassword(String trustStorePassword);
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ import org.graylog2.syslog4j.impl.net.tcp.TCPNetSyslogWriter;
|
|||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogWriter is an implementation of Runnable that supports sending
|
* SSLTCPNetSyslogWriter is an implementation of Runnable that supports sending
|
||||||
* TCP/IP-based (over SSL/TLS) messages within a separate Thread.
|
* TCP/IP-based (over SSL/TLS) messages within a separate Thread.
|
||||||
*
|
* <p/>
|
||||||
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
* <p>When used in "threaded" mode (see TCPNetSyslogConfig for the option),
|
||||||
* a queuing mechanism is used (via LinkedList).</p>
|
* a queuing mechanism is used (via LinkedList).</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.impl.net.tcp.ssl.SSLTCPNetSyslogWriter;
|
|||||||
/**
|
/**
|
||||||
* PooledSSLTCPNetSyslogConfig is an extension of PooledTCPNetSyslogConfig
|
* PooledSSLTCPNetSyslogConfig is an extension of PooledTCPNetSyslogConfig
|
||||||
* which provides configuration support for the Apache Commons Pool.
|
* which provides configuration support for the Apache Commons Pool.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -13,7 +13,7 @@ import org.graylog2.syslog4j.impl.net.AbstractNetSyslog;
|
|||||||
/**
|
/**
|
||||||
* UDPNetSyslog is an extension of AbstractSyslog that provides support for
|
* UDPNetSyslog is an extension of AbstractSyslog that provides support for
|
||||||
* UDP/IP-based syslog clients.
|
* UDP/IP-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.impl.net.AbstractNetSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* UDPNetSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
* UDPNetSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
||||||
* configuration support for UDP/IP-based syslog clients.
|
* configuration support for UDP/IP-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -10,7 +10,7 @@ import org.graylog2.syslog4j.impl.AbstractSyslogWriter;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogPoolFactory is an abstract implementation of the Apache Commons Pool
|
* AbstractSyslogPoolFactory is an abstract implementation of the Apache Commons Pool
|
||||||
* BasePoolableObjectFactory.
|
* BasePoolableObjectFactory.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.impl.pool.AbstractSyslogPoolFactory;
|
|||||||
/**
|
/**
|
||||||
* GenericSyslogPoolFactory is an implementation of the Apache Commons Pool
|
* GenericSyslogPoolFactory is an implementation of the Apache Commons Pool
|
||||||
* BasePoolableObjectFactory using a GenericObjectPool.
|
* BasePoolableObjectFactory using a GenericObjectPool.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -13,10 +13,10 @@ import com.sun.jna.Native;
|
|||||||
/**
|
/**
|
||||||
* UnixSyslog is an extension of AbstractSyslog that provides support for
|
* UnixSyslog is an extension of AbstractSyslog that provides support for
|
||||||
* Unix-based syslog clients.
|
* Unix-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>This class requires the JNA (Java Native Access) library to directly
|
* <p>This class requires the JNA (Java Native Access) library to directly
|
||||||
* access the native C libraries utilized on Unix platforms.</p>
|
* access the native C libraries utilized on Unix platforms.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -31,7 +31,9 @@ public class UnixSyslog extends AbstractSyslog {
|
|||||||
|
|
||||||
protected interface CLibrary extends Library {
|
protected interface CLibrary extends Library {
|
||||||
public void openlog(final Memory ident, int option, int facility);
|
public void openlog(final Memory ident, int option, int facility);
|
||||||
|
|
||||||
public void syslog(int priority, final String format, final String message);
|
public void syslog(int priority, final String format, final String message);
|
||||||
|
|
||||||
public void closelog();
|
public void closelog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.impl.AbstractSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* UnixSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
* UnixSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
||||||
* configuration support for Unix-based syslog clients.
|
* configuration support for Unix-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -14,10 +14,10 @@ import com.sun.jna.Structure;
|
|||||||
/**
|
/**
|
||||||
* UnixSocketSyslog is an extension of AbstractSyslog that provides support for
|
* UnixSocketSyslog is an extension of AbstractSyslog that provides support for
|
||||||
* Unix socket-based syslog clients.
|
* Unix socket-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>This class requires the JNA (Java Native Access) library to directly
|
* <p>This class requires the JNA (Java Native Access) library to directly
|
||||||
* access the native C libraries utilized on Unix platforms.</p>
|
* access the native C libraries utilized on Unix platforms.</p>
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -43,9 +43,13 @@ public class UnixSocketSyslog extends AbstractSyslog {
|
|||||||
|
|
||||||
protected interface CLibrary extends Library {
|
protected interface CLibrary extends Library {
|
||||||
public int socket(int domain, int type, int protocol);
|
public int socket(int domain, int type, int protocol);
|
||||||
|
|
||||||
public int connect(int sockfd, SockAddr sockaddr, int addrlen);
|
public int connect(int sockfd, SockAddr sockaddr, int addrlen);
|
||||||
|
|
||||||
public int write(int fd, ByteBuffer buffer, int count);
|
public int write(int fd, ByteBuffer buffer, int count);
|
||||||
|
|
||||||
public int close(int fd);
|
public int close(int fd);
|
||||||
|
|
||||||
public String strerror(int errno);
|
public String strerror(int errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import org.graylog2.syslog4j.impl.AbstractSyslogConfig;
|
|||||||
/**
|
/**
|
||||||
* UnixSocketSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
* UnixSocketSyslogConfig is an extension of AbstractNetSyslogConfig that provides
|
||||||
* configuration support for Unix socket-based syslog clients.
|
* configuration support for Unix socket-based syslog clients.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -15,7 +15,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* This class provides a Singleton-based interface for Syslog4j
|
* This class provides a Singleton-based interface for Syslog4j
|
||||||
* server implementations.
|
* server implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -9,7 +9,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
/**
|
/**
|
||||||
* SyslogServerConfigIF provides a common, extensible configuration interface for all
|
* SyslogServerConfigIF provides a common, extensible configuration interface for all
|
||||||
* implementations of SyslogServerIF.
|
* implementations of SyslogServerIF.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -21,30 +21,40 @@ public interface SyslogServerConfigIF extends SyslogConstants, SyslogCharSetIF {
|
|||||||
public Class getSyslogServerClass();
|
public Class getSyslogServerClass();
|
||||||
|
|
||||||
public String getHost();
|
public String getHost();
|
||||||
|
|
||||||
public void setHost(String host) throws SyslogRuntimeException;
|
public void setHost(String host) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public int getPort();
|
public int getPort();
|
||||||
|
|
||||||
public void setPort(int port) throws SyslogRuntimeException;
|
public void setPort(int port) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public boolean isUseDaemonThread();
|
public boolean isUseDaemonThread();
|
||||||
|
|
||||||
public void setUseDaemonThread(boolean useDaemonThread);
|
public void setUseDaemonThread(boolean useDaemonThread);
|
||||||
|
|
||||||
public int getThreadPriority();
|
public int getThreadPriority();
|
||||||
|
|
||||||
public void setThreadPriority(int threadPriority);
|
public void setThreadPriority(int threadPriority);
|
||||||
|
|
||||||
public List getEventHandlers();
|
public List getEventHandlers();
|
||||||
|
|
||||||
public long getShutdownWait();
|
public long getShutdownWait();
|
||||||
|
|
||||||
public void setShutdownWait(long shutdownWait);
|
public void setShutdownWait(long shutdownWait);
|
||||||
|
|
||||||
public void addEventHandler(SyslogServerEventHandlerIF eventHandler);
|
public void addEventHandler(SyslogServerEventHandlerIF eventHandler);
|
||||||
|
|
||||||
public void insertEventHandler(int pos, SyslogServerEventHandlerIF eventHandler);
|
public void insertEventHandler(int pos, SyslogServerEventHandlerIF eventHandler);
|
||||||
|
|
||||||
public void removeEventHandler(SyslogServerEventHandlerIF eventHandler);
|
public void removeEventHandler(SyslogServerEventHandlerIF eventHandler);
|
||||||
|
|
||||||
public void removeAllEventHandlers();
|
public void removeAllEventHandlers();
|
||||||
|
|
||||||
public boolean isUseStructuredData();
|
public boolean isUseStructuredData();
|
||||||
|
|
||||||
public void setUseStructuredData(boolean useStructuredData);
|
public void setUseStructuredData(boolean useStructuredData);
|
||||||
|
|
||||||
public Object getDateTimeFormatter();
|
public Object getDateTimeFormatter();
|
||||||
|
|
||||||
public void setDateTimeFormatter(Object dateTimeFormatter);
|
public void setDateTimeFormatter(Object dateTimeFormatter);
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,6 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public abstract interface SyslogServerEventHandlerIF extends Serializable {
|
public abstract interface SyslogServerEventHandlerIF extends Serializable {
|
||||||
public void initialize(SyslogServerIF syslogServer);
|
public void initialize(SyslogServerIF syslogServer);
|
||||||
|
|
||||||
public void destroy(SyslogServerIF syslogServer);
|
public void destroy(SyslogServerIF syslogServer);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import org.graylog2.syslog4j.SyslogCharSetIF;
|
|||||||
/**
|
/**
|
||||||
* SyslogServerEventIF provides an extensible interface for Syslog4j
|
* SyslogServerEventIF provides an extensible interface for Syslog4j
|
||||||
* server events.
|
* server events.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -24,18 +24,24 @@ public interface SyslogServerEventIF extends SyslogCharSetIF {
|
|||||||
public byte[] getRaw();
|
public byte[] getRaw();
|
||||||
|
|
||||||
public int getFacility();
|
public int getFacility();
|
||||||
|
|
||||||
public void setFacility(int facility);
|
public void setFacility(int facility);
|
||||||
|
|
||||||
public Date getDate();
|
public Date getDate();
|
||||||
|
|
||||||
public void setDate(Date date);
|
public void setDate(Date date);
|
||||||
|
|
||||||
public int getLevel();
|
public int getLevel();
|
||||||
|
|
||||||
public void setLevel(int level);
|
public void setLevel(int level);
|
||||||
|
|
||||||
public String getHost();
|
public String getHost();
|
||||||
|
|
||||||
public void setHost(String host);
|
public void setHost(String host);
|
||||||
|
|
||||||
public boolean isHostStrippedFromMessage();
|
public boolean isHostStrippedFromMessage();
|
||||||
|
|
||||||
public String getMessage();
|
public String getMessage();
|
||||||
|
|
||||||
public void setMessage(String message);
|
public void setMessage(String message);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SyslogServerIF provides a common interface for all Syslog4j server implementations.
|
* SyslogServerIF provides a common interface for all Syslog4j server implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -16,11 +16,13 @@ public interface SyslogServerIF extends Runnable {
|
|||||||
public void initialize(String protocol, SyslogServerConfigIF config) throws SyslogRuntimeException;
|
public void initialize(String protocol, SyslogServerConfigIF config) throws SyslogRuntimeException;
|
||||||
|
|
||||||
public String getProtocol();
|
public String getProtocol();
|
||||||
|
|
||||||
public SyslogServerConfigIF getConfig();
|
public SyslogServerConfigIF getConfig();
|
||||||
|
|
||||||
public void run();
|
public void run();
|
||||||
|
|
||||||
public Thread getThread();
|
public Thread getThread();
|
||||||
|
|
||||||
public void setThread(Thread thread);
|
public void setThread(Thread thread);
|
||||||
|
|
||||||
public void shutdown();
|
public void shutdown();
|
||||||
|
@ -8,7 +8,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* This class provides a command-line interface for Syslog4j
|
* This class provides a command-line interface for Syslog4j
|
||||||
* server implementations.
|
* server implementations.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -61,13 +61,47 @@ public class SyslogServerMain {
|
|||||||
String arg = args[i++];
|
String arg = args[i++];
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
|
|
||||||
if ("-h".equals(arg)) { if (i == args.length) { options.usage = "Must specify host with -h"; return options; } match = true; options.host = args[i++]; }
|
if ("-h".equals(arg)) {
|
||||||
if ("-p".equals(arg)) { if (i == args.length) { options.usage = "Must specify port with -p"; return options; } match = true; options.port = args[i++]; }
|
if (i == args.length) {
|
||||||
if ("-t".equals(arg)) { if (i == args.length) { options.usage = "Must specify value (in milliseconds)"; return options; } match = true; options.timeout = args[i++]; }
|
options.usage = "Must specify host with -h";
|
||||||
if ("-o".equals(arg)) { if (i == args.length) { options.usage = "Must specify file with -o"; return options; } match = true; options.fileName = args[i++]; }
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.host = args[i++];
|
||||||
|
}
|
||||||
|
if ("-p".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify port with -p";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.port = args[i++];
|
||||||
|
}
|
||||||
|
if ("-t".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify value (in milliseconds)";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.timeout = args[i++];
|
||||||
|
}
|
||||||
|
if ("-o".equals(arg)) {
|
||||||
|
if (i == args.length) {
|
||||||
|
options.usage = "Must specify file with -o";
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
match = true;
|
||||||
|
options.fileName = args[i++];
|
||||||
|
}
|
||||||
|
|
||||||
if ("-a".equals(arg)) { match = true; options.append = true; }
|
if ("-a".equals(arg)) {
|
||||||
if ("-q".equals(arg)) { match = true; options.quiet = true; }
|
match = true;
|
||||||
|
options.append = true;
|
||||||
|
}
|
||||||
|
if ("-q".equals(arg)) {
|
||||||
|
match = true;
|
||||||
|
options.quiet = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
if (options.protocol != null) {
|
if (options.protocol != null) {
|
||||||
@ -97,7 +131,11 @@ public class SyslogServerMain {
|
|||||||
|
|
||||||
if (options.usage != null) {
|
if (options.usage != null) {
|
||||||
usage(options.usage);
|
usage(options.usage);
|
||||||
if (CALL_SYSTEM_EXIT_ON_FAILURE) { System.exit(1); } else { return; }
|
if (CALL_SYSTEM_EXIT_ON_FAILURE) {
|
||||||
|
System.exit(1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options.quiet) {
|
if (!options.quiet) {
|
||||||
@ -106,7 +144,11 @@ public class SyslogServerMain {
|
|||||||
|
|
||||||
if (!SyslogServer.exists(options.protocol)) {
|
if (!SyslogServer.exists(options.protocol)) {
|
||||||
usage("Protocol \"" + options.protocol + "\" not supported");
|
usage("Protocol \"" + options.protocol + "\" not supported");
|
||||||
if (CALL_SYSTEM_EXIT_ON_FAILURE) { System.exit(1); } else { return; }
|
if (CALL_SYSTEM_EXIT_ON_FAILURE) {
|
||||||
|
System.exit(1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SyslogServerIF syslogServer = SyslogServer.getInstance(options.protocol);
|
SyslogServerIF syslogServer = SyslogServer.getInstance(options.protocol);
|
||||||
|
@ -4,7 +4,10 @@ import java.net.SocketAddress;
|
|||||||
|
|
||||||
public interface SyslogServerSessionEventHandlerIF extends SyslogServerEventHandlerIF {
|
public interface SyslogServerSessionEventHandlerIF extends SyslogServerEventHandlerIF {
|
||||||
public Object sessionOpened(SyslogServerIF syslogServer, SocketAddress socketAddress);
|
public Object sessionOpened(SyslogServerIF syslogServer, SocketAddress socketAddress);
|
||||||
|
|
||||||
public void event(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event);
|
public void event(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event);
|
||||||
|
|
||||||
public void exception(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, Exception exception);
|
public void exception(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, Exception exception);
|
||||||
|
|
||||||
public void sessionClosed(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, boolean timeout);
|
public void sessionClosed(Object session, SyslogServerIF syslogServer, SocketAddress socketAddress, boolean timeout);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import java.net.SocketAddress;
|
|||||||
/**
|
/**
|
||||||
* SyslogServerEventHandlerIF provides an extensible interface for Syslog4j
|
* SyslogServerEventHandlerIF provides an extensible interface for Syslog4j
|
||||||
* server event handlers.
|
* server event handlers.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -16,5 +16,6 @@ import java.net.SocketAddress;
|
|||||||
*/
|
*/
|
||||||
public interface SyslogServerSessionlessEventHandlerIF extends SyslogServerEventHandlerIF {
|
public interface SyslogServerSessionlessEventHandlerIF extends SyslogServerEventHandlerIF {
|
||||||
public void event(SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event);
|
public void event(SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event);
|
||||||
|
|
||||||
public void exception(SyslogServerIF syslogServer, SocketAddress socketAddress, Exception exception);
|
public void exception(SyslogServerIF syslogServer, SocketAddress socketAddress, Exception exception);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractSyslogServer provides a base abstract implementation of the SyslogServerIF.
|
* AbstractSyslogServer provides a base abstract implementation of the SyslogServerIF.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -10,7 +10,7 @@ import org.graylog2.syslog4j.server.SyslogServerEventHandlerIF;
|
|||||||
/**
|
/**
|
||||||
* AbstractSyslogServerConfig provides a base abstract implementation of the SyslogServerConfigIF
|
* AbstractSyslogServerConfig provides a base abstract implementation of the SyslogServerConfigIF
|
||||||
* configuration interface.
|
* configuration interface.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -13,7 +13,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SyslogServerEvent provides an implementation of the SyslogServerEventIF interface.
|
* SyslogServerEvent provides an implementation of the SyslogServerEventIF interface.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -39,7 +39,8 @@ public class SyslogServerEvent implements SyslogServerEventIF {
|
|||||||
protected String message = null;
|
protected String message = null;
|
||||||
protected InetAddress inetAddress = null;
|
protected InetAddress inetAddress = null;
|
||||||
|
|
||||||
protected SyslogServerEvent() { }
|
protected SyslogServerEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
public SyslogServerEvent(final String message, InetAddress inetAddress) {
|
public SyslogServerEvent(final String message, InetAddress inetAddress) {
|
||||||
initialize(message, inetAddress);
|
initialize(message, inetAddress);
|
||||||
|
@ -12,7 +12,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
/**
|
/**
|
||||||
* SystemOutSyslogServerEventHandler provides a simple example implementation
|
* SystemOutSyslogServerEventHandler provides a simple example implementation
|
||||||
* of the SyslogServerEventHandlerIF which writes the events to System.out.
|
* of the SyslogServerEventHandlerIF which writes the events to System.out.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -13,11 +13,11 @@ import org.graylog2.syslog4j.server.impl.event.SyslogServerEvent;
|
|||||||
* SyslogServerStructuredEvent provides an implementation of the
|
* SyslogServerStructuredEvent provides an implementation of the
|
||||||
* SyslogServerEventIF interface that supports receiving of structured syslog
|
* SyslogServerEventIF interface that supports receiving of structured syslog
|
||||||
* messages, as defined in:
|
* messages, as defined in:
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
* http://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p>
|
||||||
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
* Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the
|
||||||
* LGPL license is available in the META-INF folder in all distributions of
|
* LGPL license is available in the META-INF folder in all distributions of
|
||||||
|
@ -5,7 +5,7 @@ import org.graylog2.syslog4j.server.impl.AbstractSyslogServerConfig;
|
|||||||
/**
|
/**
|
||||||
* AbstractNetSyslogServerConfig provides a base abstract implementation of the AbstractSyslogServerConfig
|
* AbstractNetSyslogServerConfig provides a base abstract implementation of the AbstractSyslogServerConfig
|
||||||
* configuration interface.
|
* configuration interface.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -21,7 +21,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TCPNetSyslogServer provides a simple threaded TCP/IP server implementation.
|
* TCPNetSyslogServer provides a simple threaded TCP/IP server implementation.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.server.impl.net.AbstractNetSyslogServerConfig;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TCPNetSyslogServerConfig provides configuration for TCPNetSyslogServer.
|
* TCPNetSyslogServerConfig provides configuration for TCPNetSyslogServer.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.server.SyslogServerConfigIF;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TCPNetSyslogServerConfigIF provides configuration for TCPNetSyslogServer.
|
* TCPNetSyslogServerConfigIF provides configuration for TCPNetSyslogServer.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -17,14 +17,18 @@ public interface TCPNetSyslogServerConfigIF extends SyslogServerConfigIF {
|
|||||||
public final static byte MAX_ACTIVE_SOCKETS_BEHAVIOR_REJECT = 1;
|
public final static byte MAX_ACTIVE_SOCKETS_BEHAVIOR_REJECT = 1;
|
||||||
|
|
||||||
public int getTimeout();
|
public int getTimeout();
|
||||||
|
|
||||||
public void setTimeout(int timeout);
|
public void setTimeout(int timeout);
|
||||||
|
|
||||||
public int getBacklog();
|
public int getBacklog();
|
||||||
|
|
||||||
public void setBacklog(int backlog);
|
public void setBacklog(int backlog);
|
||||||
|
|
||||||
public int getMaxActiveSockets();
|
public int getMaxActiveSockets();
|
||||||
|
|
||||||
public void setMaxActiveSockets(int maxActiveSockets);
|
public void setMaxActiveSockets(int maxActiveSockets);
|
||||||
|
|
||||||
public byte getMaxActiveSocketsBehavior();
|
public byte getMaxActiveSocketsBehavior();
|
||||||
|
|
||||||
public void setMaxActiveSocketsBehavior(byte maxActiveSocketsBehavior);
|
public void setMaxActiveSocketsBehavior(byte maxActiveSocketsBehavior);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import org.graylog2.syslog4j.server.impl.net.tcp.TCPNetSyslogServer;
|
|||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogServer provides a simple threaded TCP/IP server implementation
|
* SSLTCPNetSyslogServer provides a simple threaded TCP/IP server implementation
|
||||||
* which uses SSL/TLS.
|
* which uses SSL/TLS.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.server.impl.net.tcp.TCPNetSyslogServerConfig;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogServerConfig provides configuration for SSLTCPNetSyslogServer.
|
* SSLTCPNetSyslogServerConfig provides configuration for SSLTCPNetSyslogServer.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.server.impl.net.tcp.TCPNetSyslogServerConfigIF;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SSLTCPNetSyslogServerConfigIF provides configuration for SSLTCPNetSyslogServer.
|
* SSLTCPNetSyslogServerConfigIF provides configuration for SSLTCPNetSyslogServer.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -14,14 +14,18 @@ import org.graylog2.syslog4j.server.impl.net.tcp.TCPNetSyslogServerConfigIF;
|
|||||||
*/
|
*/
|
||||||
public interface SSLTCPNetSyslogServerConfigIF extends TCPNetSyslogServerConfigIF {
|
public interface SSLTCPNetSyslogServerConfigIF extends TCPNetSyslogServerConfigIF {
|
||||||
public String getKeyStore();
|
public String getKeyStore();
|
||||||
|
|
||||||
public void setKeyStore(String keyStore);
|
public void setKeyStore(String keyStore);
|
||||||
|
|
||||||
public String getKeyStorePassword();
|
public String getKeyStorePassword();
|
||||||
|
|
||||||
public void setKeyStorePassword(String keyStorePassword);
|
public void setKeyStorePassword(String keyStorePassword);
|
||||||
|
|
||||||
public String getTrustStore();
|
public String getTrustStore();
|
||||||
|
|
||||||
public void setTrustStore(String trustStore);
|
public void setTrustStore(String trustStore);
|
||||||
|
|
||||||
public String getTrustStorePassword();
|
public String getTrustStorePassword();
|
||||||
|
|
||||||
public void setTrustStorePassword(String trustStorePassword);
|
public void setTrustStorePassword(String trustStorePassword);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import org.graylog2.syslog4j.util.SyslogUtility;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UDPNetSyslogServer provides a simple non-threaded UDP/IP server implementation.
|
* UDPNetSyslogServer provides a simple non-threaded UDP/IP server implementation.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -4,7 +4,7 @@ import org.graylog2.syslog4j.server.impl.net.AbstractNetSyslogServerConfig;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UDPNetSyslogServerConfig provides configuration for UDPNetSyslogServer.
|
* UDPNetSyslogServerConfig provides configuration for UDPNetSyslogServer.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ package org.graylog2.syslog4j.util;
|
|||||||
/**
|
/**
|
||||||
* OSDetectUtility provides operating system detection used to determine
|
* OSDetectUtility provides operating system detection used to determine
|
||||||
* whether Syslog4j is running on a Unix platform.
|
* whether Syslog4j is running on a Unix platform.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
|
@ -11,7 +11,7 @@ import org.graylog2.syslog4j.SyslogRuntimeException;
|
|||||||
/**
|
/**
|
||||||
* SyslogUtility provides several common utility methods used within
|
* SyslogUtility provides several common utility methods used within
|
||||||
* Syslog4j.
|
* Syslog4j.
|
||||||
*
|
* <p/>
|
||||||
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
* <p>Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
|
||||||
* of the LGPL license is available in the META-INF folder in all
|
* of the LGPL license is available in the META-INF folder in all
|
||||||
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
* distributions of Syslog4j and in the base directory of the "doc" ZIP.</p>
|
||||||
@ -41,28 +41,49 @@ public final class SyslogUtility implements SyslogConstants {
|
|||||||
|
|
||||||
public static final String getFacilityString(int syslogFacility) {
|
public static final String getFacilityString(int syslogFacility) {
|
||||||
switch (syslogFacility) {
|
switch (syslogFacility) {
|
||||||
case FACILITY_KERN: return "kern";
|
case FACILITY_KERN:
|
||||||
case FACILITY_USER: return "user";
|
return "kern";
|
||||||
case FACILITY_MAIL: return "mail";
|
case FACILITY_USER:
|
||||||
case FACILITY_DAEMON: return "daemon";
|
return "user";
|
||||||
case FACILITY_AUTH: return "auth";
|
case FACILITY_MAIL:
|
||||||
case FACILITY_SYSLOG: return "syslog";
|
return "mail";
|
||||||
case FACILITY_LPR: return "lpr";
|
case FACILITY_DAEMON:
|
||||||
case FACILITY_NEWS: return "news";
|
return "daemon";
|
||||||
case FACILITY_UUCP: return "uucp";
|
case FACILITY_AUTH:
|
||||||
case FACILITY_CRON: return "cron";
|
return "auth";
|
||||||
case FACILITY_AUTHPRIV: return "authpriv";
|
case FACILITY_SYSLOG:
|
||||||
case FACILITY_FTP: return "ftp";
|
return "syslog";
|
||||||
case FACILITY_LOCAL0: return "local0";
|
case FACILITY_LPR:
|
||||||
case FACILITY_LOCAL1: return "local1";
|
return "lpr";
|
||||||
case FACILITY_LOCAL2: return "local2";
|
case FACILITY_NEWS:
|
||||||
case FACILITY_LOCAL3: return "local3";
|
return "news";
|
||||||
case FACILITY_LOCAL4: return "local4";
|
case FACILITY_UUCP:
|
||||||
case FACILITY_LOCAL5: return "local5";
|
return "uucp";
|
||||||
case FACILITY_LOCAL6: return "local6";
|
case FACILITY_CRON:
|
||||||
case FACILITY_LOCAL7: return "local7";
|
return "cron";
|
||||||
|
case FACILITY_AUTHPRIV:
|
||||||
|
return "authpriv";
|
||||||
|
case FACILITY_FTP:
|
||||||
|
return "ftp";
|
||||||
|
case FACILITY_LOCAL0:
|
||||||
|
return "local0";
|
||||||
|
case FACILITY_LOCAL1:
|
||||||
|
return "local1";
|
||||||
|
case FACILITY_LOCAL2:
|
||||||
|
return "local2";
|
||||||
|
case FACILITY_LOCAL3:
|
||||||
|
return "local3";
|
||||||
|
case FACILITY_LOCAL4:
|
||||||
|
return "local4";
|
||||||
|
case FACILITY_LOCAL5:
|
||||||
|
return "local5";
|
||||||
|
case FACILITY_LOCAL6:
|
||||||
|
return "local6";
|
||||||
|
case FACILITY_LOCAL7:
|
||||||
|
return "local7";
|
||||||
|
|
||||||
default: return "UNKNOWN";
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,27 +97,48 @@ public final class SyslogUtility implements SyslogConstants {
|
|||||||
_facilityName = facilityName.trim();
|
_facilityName = facilityName.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
if("KERN".equalsIgnoreCase(_facilityName)) { return FACILITY_KERN;
|
if ("KERN".equalsIgnoreCase(_facilityName)) {
|
||||||
} else if("USER".equalsIgnoreCase(facilityName)) { return FACILITY_USER;
|
return FACILITY_KERN;
|
||||||
} else if("MAIL".equalsIgnoreCase(facilityName)) { return FACILITY_MAIL;
|
} else if ("USER".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("DAEMON".equalsIgnoreCase(facilityName)) { return FACILITY_DAEMON;
|
return FACILITY_USER;
|
||||||
} else if("AUTH".equalsIgnoreCase(facilityName)) { return FACILITY_AUTH;
|
} else if ("MAIL".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("SYSLOG".equalsIgnoreCase(facilityName)) { return FACILITY_SYSLOG;
|
return FACILITY_MAIL;
|
||||||
} else if("LPR".equalsIgnoreCase(facilityName)) { return FACILITY_LPR;
|
} else if ("DAEMON".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("NEWS".equalsIgnoreCase(facilityName)) { return FACILITY_NEWS;
|
return FACILITY_DAEMON;
|
||||||
} else if("UUCP".equalsIgnoreCase(facilityName)) { return FACILITY_UUCP;
|
} else if ("AUTH".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("CRON".equalsIgnoreCase(facilityName)) { return FACILITY_CRON;
|
return FACILITY_AUTH;
|
||||||
} else if("AUTHPRIV".equalsIgnoreCase(facilityName)) { return FACILITY_AUTHPRIV;
|
} else if ("SYSLOG".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("FTP".equalsIgnoreCase(facilityName)) { return FACILITY_FTP;
|
return FACILITY_SYSLOG;
|
||||||
} else if("LOCAL0".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL0;
|
} else if ("LPR".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("LOCAL1".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL1;
|
return FACILITY_LPR;
|
||||||
} else if("LOCAL2".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL2;
|
} else if ("NEWS".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("LOCAL3".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL3;
|
return FACILITY_NEWS;
|
||||||
} else if("LOCAL4".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL4;
|
} else if ("UUCP".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("LOCAL5".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL5;
|
return FACILITY_UUCP;
|
||||||
} else if("LOCAL6".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL6;
|
} else if ("CRON".equalsIgnoreCase(facilityName)) {
|
||||||
} else if("LOCAL7".equalsIgnoreCase(facilityName)) { return FACILITY_LOCAL7;
|
return FACILITY_CRON;
|
||||||
} else { return -1;
|
} else if ("AUTHPRIV".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_AUTHPRIV;
|
||||||
|
} else if ("FTP".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_FTP;
|
||||||
|
} else if ("LOCAL0".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL0;
|
||||||
|
} else if ("LOCAL1".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL1;
|
||||||
|
} else if ("LOCAL2".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL2;
|
||||||
|
} else if ("LOCAL3".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL3;
|
||||||
|
} else if ("LOCAL4".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL4;
|
||||||
|
} else if ("LOCAL5".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL5;
|
||||||
|
} else if ("LOCAL6".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL6;
|
||||||
|
} else if ("LOCAL7".equalsIgnoreCase(facilityName)) {
|
||||||
|
return FACILITY_LOCAL7;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,15 +152,24 @@ public final class SyslogUtility implements SyslogConstants {
|
|||||||
_levelName = levelName.trim();
|
_levelName = levelName.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
if("DEBUG".equalsIgnoreCase(_levelName)) { return LEVEL_DEBUG;
|
if ("DEBUG".equalsIgnoreCase(_levelName)) {
|
||||||
} else if("INFO".equalsIgnoreCase(_levelName)) { return LEVEL_INFO;
|
return LEVEL_DEBUG;
|
||||||
} else if("NOTICE".equalsIgnoreCase(_levelName)) { return LEVEL_NOTICE;
|
} else if ("INFO".equalsIgnoreCase(_levelName)) {
|
||||||
} else if("WARN".equalsIgnoreCase(_levelName)) { return LEVEL_WARN;
|
return LEVEL_INFO;
|
||||||
} else if("ERROR".equalsIgnoreCase(_levelName)) { return LEVEL_ERROR;
|
} else if ("NOTICE".equalsIgnoreCase(_levelName)) {
|
||||||
} else if("CRITICAL".equalsIgnoreCase(_levelName)) { return LEVEL_CRITICAL;
|
return LEVEL_NOTICE;
|
||||||
} else if("ALERT".equalsIgnoreCase(_levelName)) { return LEVEL_ALERT;
|
} else if ("WARN".equalsIgnoreCase(_levelName)) {
|
||||||
} else if("EMERGENCY".equalsIgnoreCase(_levelName)) { return LEVEL_EMERGENCY;
|
return LEVEL_WARN;
|
||||||
} else { return -1;
|
} else if ("ERROR".equalsIgnoreCase(_levelName)) {
|
||||||
|
return LEVEL_ERROR;
|
||||||
|
} else if ("CRITICAL".equalsIgnoreCase(_levelName)) {
|
||||||
|
return LEVEL_CRITICAL;
|
||||||
|
} else if ("ALERT".equalsIgnoreCase(_levelName)) {
|
||||||
|
return LEVEL_ALERT;
|
||||||
|
} else if ("EMERGENCY".equalsIgnoreCase(_levelName)) {
|
||||||
|
return LEVEL_EMERGENCY;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,14 +233,22 @@ public final class SyslogUtility implements SyslogConstants {
|
|||||||
|
|
||||||
public static final String getLevelString(int level) {
|
public static final String getLevelString(int level) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case SyslogConstants.LEVEL_DEBUG: return "DEBUG";
|
case SyslogConstants.LEVEL_DEBUG:
|
||||||
case SyslogConstants.LEVEL_INFO: return "INFO";
|
return "DEBUG";
|
||||||
case SyslogConstants.LEVEL_NOTICE: return "NOTICE";
|
case SyslogConstants.LEVEL_INFO:
|
||||||
case SyslogConstants.LEVEL_WARN: return "WARN";
|
return "INFO";
|
||||||
case SyslogConstants.LEVEL_ERROR: return "ERROR";
|
case SyslogConstants.LEVEL_NOTICE:
|
||||||
case SyslogConstants.LEVEL_CRITICAL: return "CRITICAL";
|
return "NOTICE";
|
||||||
case SyslogConstants.LEVEL_ALERT: return "ALERT";
|
case SyslogConstants.LEVEL_WARN:
|
||||||
case SyslogConstants.LEVEL_EMERGENCY: return "EMERGENCY";
|
return "WARN";
|
||||||
|
case SyslogConstants.LEVEL_ERROR:
|
||||||
|
return "ERROR";
|
||||||
|
case SyslogConstants.LEVEL_CRITICAL:
|
||||||
|
return "CRITICAL";
|
||||||
|
case SyslogConstants.LEVEL_ALERT:
|
||||||
|
return "ALERT";
|
||||||
|
case SyslogConstants.LEVEL_EMERGENCY:
|
||||||
|
return "EMERGENCY";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user