当前位置: 首页>>代码示例>>Java>>正文


Java Logger类代码示例

本文整理汇总了Java中org.apache.catalina.Logger的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Logger类属于org.apache.catalina包,在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any)
 *
 * @param message Message to be logged
 */
private void log(String message) {

    Logger logger = null;
    if (container != null)
        logger = container.getLogger();
    if (logger != null)
        logger.log("WebappLoader[" + container.getName() + "]: "
                   + message);
    else {
        String containerName = null;
        if (container != null)
            containerName = container.getName();
        System.out.println("WebappLoader[" + containerName
                           + "]: " + message);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:WebappLoader.java

示例2: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Host (if any)
 *
 * @param message Message to be logged
 * @param throwable Associated exception
 */
protected void log(String message, Throwable throwable) {

    Logger logger = null;
    if (host != null)
        logger = host.getLogger();
    if (logger != null)
        logger.log("HostConfig[" + host.getName() + "] "
                   + message, throwable);
    else {
        System.out.println("HostConfig[" + host.getName() + "]: "
                           + message);
        System.out.println("" + throwable);
        throwable.printStackTrace(System.out);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:HostConfig.java

示例3: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Context (if any)
 *
 * @param message Message to be logged
 * @param throwable Associated exception
 */
private void log(String message, Throwable throwable) {

    Logger logger = null;
    if (context != null)
        logger = context.getLogger();
    if (logger != null)
        logger.log("ContextConfig[" + context.getName() + "] "
                   + message, throwable);
    else {
        System.out.println("ContextConfig[" + context.getName() + "]: "
                           + message);
        System.out.println("" + throwable);
        throwable.printStackTrace(System.out);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:ContextConfig.java

示例4: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Host (if any)
 *
 * @param message Message to be logged
 * @param throwable Associated exception
 */
private void log(String message, Throwable throwable) {

    Logger logger = null;
    if (host != null)
        logger = host.getLogger();
    if (logger != null)
        logger.log("UserConfig[" + host.getName() + "] "
                   + message, throwable);
    else {
        System.out.println("UserConfig[" + host.getName() + "]: "
                           + message);
        System.out.println("" + throwable);
        throwable.printStackTrace(System.out);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:UserConfig.java

示例5: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any).
 *
 * @param message Message to be logged
 */
protected void log(String message) {
    Logger logger = null;
    Container container = manager.getContainer();

    if (container != null)
        logger = container.getLogger();

    if (logger != null) {
        logger.log(getStoreName()+"[" + container.getName() + "]: "
                   + message);
    } else {
        String containerName = null;
        if (container != null)
            containerName = container.getName();
        System.out.println(getStoreName()+"[" + containerName
                           + "]: " + message);
    }
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:24,代码来源:StoreBase.java

示例6: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any).
 *
 * @param message Message to be logged
 */
void log(String message) {

    Logger logger = null;
    if (container != null)
        logger = container.getLogger();
    if (logger != null)
        logger.log(getName() + "[" + container.getName() + "]: "
                   + message);
    else {
        String containerName = null;
        if (container != null)
            containerName = container.getName();
        System.out.println(getName() + "[" + containerName
                           + "]: " + message);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:ManagerBase.java

示例7: createMBean

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Create, register, and return an MBean for this
 * <code>Logger</code> object.
 *
 * @param logger The Logger to be managed
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public static ModelMBean createMBean(Logger logger)
    throws Exception {

    String mname = createManagedName(logger);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        Exception e = new Exception("ManagedBean is not found with "+mname);
        throw new MBeanException(e);
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ModelMBean mbean = managed.createMBean(logger);
    ObjectName oname = createObjectName(domain, logger);
    mserver.registerMBean(mbean, oname);
    return (mbean);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:27,代码来源:MBeanUtils.java

示例8: destroyMBean

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Deregister the MBean for this
 * <code>Logger</code> object.
 *
 * @param logger The Logger to be managed
 *
 * @exception Exception if an MBean cannot be deregistered
 */
public static void destroyMBean(Logger logger)
    throws Exception {

    String mname = createManagedName(logger);
    ManagedBean managed = registry.findManagedBean(mname);
    if (managed == null) {
        return;
    }
    String domain = managed.getDomain();
    if (domain == null)
        domain = mserver.getDefaultDomain();
    ObjectName oname = createObjectName(domain, logger);
    mserver.unregisterMBean(oname);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:24,代码来源:MBeanUtils.java

示例9: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any)
 *
 * @param message Message to be logged
 */
protected void log(String message) {

    Logger logger = null;
    String name = null;
    if (container != null) {
        logger = container.getLogger();
        name = container.getName();
    }

    if (logger != null) {
        logger.log(getName()+"[" + name + "]: " + message);
    } else {
        System.out.println(getName()+"[" + name + "]: " + message);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:22,代码来源:RealmBase.java

示例10: getClusterSender

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Returns a <code>ClusterSender</code> which is the interface
 * to use when sending information in the Cluster. senderId is
 * used as a identifier so that information sent through this
 * instance can only be used with the respectice
 * <code>ClusterReceiver</code>
 *
 * @return The ClusterSender
 */
public ClusterSender getClusterSender(String senderId) {
    Logger logger = null;
    MulticastSender send = new MulticastSender(senderId,
                                               multicastSocket,
                                               multicastAddress,
                                               multicastPort);
    if (container != null)
        logger = container.getLogger();

    send.setLogger(logger);
    send.setDebug(debug);

    if(debug > 1)
        log(sm.getString("standardCluster.createSender", senderId));

    return(send);
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:27,代码来源:StandardCluster.java

示例11: getClusterReceiver

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Returns a <code>ClusterReceiver</code> which is the interface
 * to use when receiving information in the Cluster. senderId is
 * used as a indentifier, only information send through the
 * <code>ClusterSender</code> with the same senderId can be received.
 *
 * @return The ClusterReceiver
 */
public ClusterReceiver getClusterReceiver(String senderId) {
    Logger logger = null;
    MulticastReceiver recv = new MulticastReceiver(senderId,
                                                   multicastSocket,
                                                   multicastAddress,
                                                   multicastPort);

    if (container != null)
        logger = container.getLogger();

    recv.setDebug(debug);
    recv.setLogger(logger);
    recv.setCheckInterval(checkInterval);
    recv.start();

    if(debug > 1)
        log(sm.getString("standardCluster.createReceiver", senderId));

    return(recv);
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:29,代码来源:StandardCluster.java

示例12: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any).
 *
 * @param message Message to be logged
 */
protected void log(String message) {
    Logger logger = null;

    if (container != null)
        logger = container.getLogger();

    if (logger != null) {
        logger.log(getName() + "[" + container.getName() + "]: "
                   + message);
    } else {
        String containerName = null;
        if (container != null)
            containerName = container.getName();

        System.out.println(getName() + "[" + containerName
                           + "]: " + message);
    }
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:24,代码来源:StandardCluster.java

示例13: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any).
 *
 * @param message Message to be logged
 * @param throwable Associated exception
 */
protected void log(String message, Throwable throwable) {

    Logger logger = null;
    if (container != null)
        logger = container.getLogger();
    if (logger != null)
        logger.log("StandardPipeline[" + container.getName() + "]: " +
                   message, throwable);
    else {
        System.out.println("StandardPipeline[" + container.getName() +
                           "]: " + message);
        throwable.printStackTrace(System.out);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:22,代码来源:StandardPipeline.java

示例14: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log a message on the Logger associated with our Container (if any)
 *
 * @param message Message to be logged
 */
private void log(String message) {

    Logger logger = null;
    if (container != null)
        logger = container.getLogger();
    if (logger != null)
        logger.log("StandardWrapperValve[" + container.getName() + "]: "
                   + message);
    else {
        String containerName = null;
        if (container != null)
            containerName = container.getName();
        System.out.println("StandardWrapperValve[" + containerName
                           + "]: " + message);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:23,代码来源:StandardWrapperValve.java

示例15: log

import org.apache.catalina.Logger; //导入依赖的package包/类
/**
 * Log the specified message and exception to our current Logger
 * (if any).
 *
 * @param message Message to be logged
 * @param throwable Related exception
 */
protected void log(String message, Throwable throwable) {

    if (!(container instanceof Container)) {
        System.out.println(logName() + ": " + message + ": " + throwable);
        throwable.printStackTrace(System.out);
        return;
    }

    Logger logger = ((Container) container).getLogger();
    if (logger != null)
        logger.log(logName() + ": " + message, throwable);
    else {
        System.out.println(logName() + ": " + message + ": " + throwable);
        throwable.printStackTrace(System.out);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:25,代码来源:NamingContextListener.java


注:本文中的org.apache.catalina.Logger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。