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


Java LogService类代码示例

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


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

示例1: Component

import org.restlet.service.LogService; //导入依赖的package包/类
/**
 * Constructor.
 */
public Component() {
    super();
    this.hosts = new CopyOnWriteArrayList<VirtualHost>();
    this.clients = new ClientList(null);
    this.servers = new ServerList(null, this);
    this.realms = new CopyOnWriteArrayList<Realm>();
    this.services = new ServiceList(getContext());

    if (Engine.getInstance() != null) {
        // To be done before setting the helper...
        this.services.add(new org.restlet.service.TaskService());

        this.helper = new ComponentHelper(this);
        Context childContext = getContext().createChildContext();
        this.defaultHost = new VirtualHost(childContext);
        this.internalRouter = new InternalRouter(childContext);
        this.services.add(new LogService());
        getLogService().setContext(childContext);
        this.services.add(new StatusService());
        this.clients.setContext(childContext);
        this.servers.setContext(childContext);
    }
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:27,代码来源:Component.java

示例2: createComponent

import org.restlet.service.LogService; //导入依赖的package包/类
@Override
protected Component createComponent() {
	Component component = super.createComponent();
	
	// a bit more configuration by initParams
	LogService log = component.getLogService();
	
	// allow access to the LogService in the application via the context
	component.getContext().getAttributes().put(LogService.class.getName(), log);
	
	// modify the logger name
	String loggerName = getInitParameter(LOGGER_NAME_ATTRIBUTE, LOGGER_NAME_ATTRIBUTE_DEFAULT_VALUE);
	log.setLoggerName(loggerName);
	
	// modify the logger pattern
	// note: overridden to be smaller than the restlet default value
	log.setResponseLogFormat(getInitParameter(LOGGER_FORMAT_ATTRIBUTE, LOGGER_FORMAT_ATTRIBUTE_DEFAULT_VALUE));
	
	return component;
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:21,代码来源:OntopiaServlet.java

示例3: LogFilter

import org.restlet.service.LogService; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param context
 *            The context.
 * @param logService
 *            The log service descriptor.
 */
public LogFilter(Context context, LogService logService) {
    super(context);
    this.logService = logService;

    if (logService != null) {
        if (logService.getLoggerName() != null) {
            this.logLogger = Engine.getLogger(logService.getLoggerName());
        } else {
            this.logLogger = Engine.getLogger(LogUtils.getBestClassName(logService.getClass()));
        }
    }
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:21,代码来源:LogFilter.java

示例4: main

import org.restlet.service.LogService; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	NATPuncher.init();
	GameMatcher.init();

	Component component = new Component();
	component.setLogService(new LogService(false));
	component.getServers().add(Protocol.HTTP, Constants.RESTLET_PORT);
	component.getDefaultHost().attach(new Main());
	component.start();
}
 
开发者ID:jlaws,项目名称:gundog-engine,代码行数:11,代码来源:Main.java

示例5: getLogService

import org.restlet.service.LogService; //导入依赖的package包/类
/**
 * Returns the global log service. On the first call, if no log service was
 * defined via the {@link #setLogService(LogService)} method, then a default
 * logger service is created. This service will be enabled by default and
 * has a logger name composed the "org.restlet." prefix followed by the
 * simple component class name (without packages), followed by the
 * ".LogService" suffix.
 * 
 * @return The global log service.
 */
public LogService getLogService() {
    return getServices().get(LogService.class);
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:14,代码来源:Component.java

示例6: setLogService

import org.restlet.service.LogService; //导入依赖的package包/类
/**
 * Sets the global log service.
 * 
 * @param logService
 *            The global log service.
 */
public void setLogService(LogService logService) {
    getServices().set(logService);
}
 
开发者ID:restlet,项目名称:restlet-framework,代码行数:10,代码来源:Component.java


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