资源简介
syslog4j 版本4.0.0,源码在src/main/java中
代码片段和文件信息
/**
*
* (C) Copyright 2008-2011 syslog4j.org
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 2.1 which accompanies this distribution and is available at
* http://www.gnu.org/licenses/lgpl-2.1.html
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.nesscomputing.syslog4j;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.nesscomputing.syslog4j.impl.net.tcp.TCPNetSyslogConfig;
import com.nesscomputing.syslog4j.impl.net.udp.UDPNetSyslogConfig;
import com.nesscomputing.syslog4j.impl.unix.UnixSyslogConfig;
import com.nesscomputing.syslog4j.impl.unix.socket.UnixSocketSyslogConfig;
import com.nesscomputing.syslog4j.util.OSDetectUtility;
import com.nesscomputing.syslog4j.util.SyslogUtility;
/**
* This class provides a Singleton interface for Syslog4j client implementations.
*
* Usage examples:
*
* Direct
*
* Syslog.getInstance(“udp“).info(“log message“);
*
*
* Via Instance
*
* SyslogIF syslog = Syslog.getInstance(“udp“);
* syslog.info();
*
*
* 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 Syslog4j and in the base directory of the “doc“ ZIP.
*
* @author <syslog4j@productivity.org>
* @version $Id: Syslog.javav 1.23 2011/01/23 20:49:12 cvs Exp $
*/
public final class Syslog
{
protected static final Map instances = Maps.newHashMap();
/**
* Set up the default TCP and UDP Syslog protocols as
* well as UNIX_SYSLOG and UNIX_SOCKET (if running on a Unix-based system).
*/
static {
initialize();
}
/**
* Syslog is a singleton.
*/
private Syslog() {
//
}
/**
* Use getInstance(protocol) as the starting point for Syslog4j.
*
* @param protocol - the Syslog protocol to use e.g. “udp“ “tcp“ “unix_syslog“ “unix_socket“ or a custom protocol
* @return Returns an instance of SyslogIF.
* @throws SyslogRuntimeException
*/
public static SyslogIF getInstance(String protocol) throws SyslogRuntimeException {
String _protocol = protocol.toLowerCase();
if (instances.containsKey(_protocol)) {
return instances.get(_protocol);
} else {
StringBuffer message = new StringBuffer(“Syslog protocol \““ + protocol + “\“ not defined; call Sys
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-10-28 17:59 syslog4j-master\
文件 131 2014-10-28 17:59 syslog4j-master\.gitignore
文件 26530 2014-10-28 17:59 syslog4j-master\LICENSE.txt
文件 200 2014-10-28 17:59 syslog4j-master\README.md
目录 0 2014-10-28 17:59 syslog4j-master\certs\
文件 2211 2014-10-28 17:59 syslog4j-master\certs\ssltest.jks
文件 3852 2014-10-28 17:59 syslog4j-master\pom.xm
目录 0 2014-10-28 17:59 syslog4j-master\src\
目录 0 2014-10-28 17:59 syslog4j-master\src\main\
目录 0 2014-10-28 17:59 syslog4j-master\src\main\java\
目录 0 2014-10-28 17:59 syslog4j-master\src\main\java\com\
目录 0 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\
目录 0 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\
文件 9794 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\Syslog.java
文件 2721 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogBackLogHandlerIF.java
文件 1241 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogCharSetIF.java
文件 2975 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogConfigIF.java
文件 7222 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogConstants.java
文件 1739 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogFacility.java
文件 2712 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogIF.java
文件 1463 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogLevel.java
文件 7976 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogMain.java
文件 1171 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogMessageIF.java
文件 1359 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogMessageModifierConfigIF.java
文件 1299 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogMessageModifierIF.java
文件 1563 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogMessageProcessorIF.java
文件 2385 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogPoolConfigIF.java
文件 1582 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\SyslogRuntimeException.java
目录 0 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\impl\
文件 14724 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\impl\AbstractSyslog.java
文件 12975 2014-10-28 17:59 syslog4j-master\src\main\java\com\nesscomputing\syslog4j\impl\AbstractSyslogConfig.java
............此处省略191个文件信息
- 上一篇:JAVA 控制台 简单的图书管理系统
- 下一篇:yGuard.jar
评论
共有 条评论