本文整理汇总了Java中org.apache.logging.log4j.LogManager.getFormatterLogger方法的典型用法代码示例。如果您正苦于以下问题:Java LogManager.getFormatterLogger方法的具体用法?Java LogManager.getFormatterLogger怎么用?Java LogManager.getFormatterLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.logging.log4j.LogManager
的用法示例。
在下文中一共展示了LogManager.getFormatterLogger方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractDXRAMService
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
/**
* Constructor
*
* @param p_shortName
* Short name of the service (used for terminal)
*/
protected AbstractDXRAMService(final String p_shortName, final Class<T> p_configClass) {
LOGGER = LogManager.getFormatterLogger(getClass().getSimpleName());
m_shortName = p_shortName;
// create default configuration
try {
m_config = p_configClass.newInstance();
} catch (final InstantiationException | IllegalAccessException e) {
throw new DXRAMRuntimeException(e);
}
}
示例2: AbstractDXRAMComponent
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
/**
* Constructor
*
* @param p_priorityInit
* Default init priority for this component
* @param p_priorityShutdown
* Default shutdown priority for this component
*/
protected AbstractDXRAMComponent(final short p_priorityInit, final short p_priorityShutdown, final Class<T> p_configClass) {
LOGGER = LogManager.getFormatterLogger(getClass().getSimpleName());
m_priorityInit = p_priorityInit;
m_priorityShutdown = p_priorityShutdown;
// create default configuration
try {
m_config = p_configClass.newInstance();
} catch (final InstantiationException | IllegalAccessException e) {
throw new DXRAMRuntimeException(e);
}
}
示例3: test01
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
@Test
public void test01() {
Logger logger = LogManager.getFormatterLogger(LogTest.class);
String name = "李志伟";
Date birthday = new Date();
logger.debug("用户名称:[{}], 日期:[{}]", name, birthday);
logger.debug("用户名称:[%s], 日期:[%s]", name, birthday);
logger.debug("用户名称:[%1$s], 日期:[%2$tY-%2$tm-%2$te]", name, birthday);
logger.debug("Integer.MAX_VALUE = [%,d]", Integer.MAX_VALUE);
logger.debug("Long.MAX_VALUE = [%,d]", Long.MAX_VALUE);
LogManager.shutdown();
}
示例4: getLogger
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
public static Logger getLogger() {
if(logger == null) {
logger = LogManager.getFormatterLogger(Reference.MODID);
}
return logger;
}
示例5: AbstractDXRAMComponentConfig
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
/**
* Constructor
*
* @param p_class
* Class extending the abstract component class of this configuration
* @param p_enabledForSuperpeer
* True to enable the component if the node is a superpeer, false to disable
* @param p_enabledForPeer
* True to enable the component if the node is a peer, false to disable
*/
protected AbstractDXRAMComponentConfig(final Class<? extends AbstractDXRAMComponent> p_class, final boolean p_enabledForSuperpeer, final boolean p_enabledForPeer) {
LOGGER = LogManager.getFormatterLogger(getClass().getSimpleName());
m_class = getClass().getName();
m_componentClass = p_class.getSimpleName();
m_enabledForSuperpeer = p_enabledForSuperpeer;
m_enabledForPeer = p_enabledForPeer;
}
示例6: AbstractDXRAMServiceConfig
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
/**
* Constructor
*
* @param p_class
* Class extending the abstract service class of this configuration
* @param p_enabledForSuperpeer
* True to enable the service if the node is a superpeer, false to disable
* @param p_enabledForPeer
* True to enable the service if the node is a peer, false to disable
*/
protected AbstractDXRAMServiceConfig(final Class<? extends AbstractDXRAMService> p_class, final boolean p_enabledForSuperpeer,
final boolean p_enabledForPeer) {
LOGGER = LogManager.getFormatterLogger(getClass().getSimpleName());
m_class = getClass().getName();
m_serviceClass = p_class.getSimpleName();
m_enabledForSuperpeer = p_enabledForSuperpeer;
m_enabledForPeer = p_enabledForPeer;
}
示例7: TaskExecutor
import org.apache.logging.log4j.LogManager; //导入方法依赖的package包/类
/**
* Creates a new TaskExecutor
*
* @param p_name
* Identifier for debug prints
* @param p_threads
* Number of Threads to create
*/
TaskExecutor(final String p_name, final int p_threads) {
LOGGER = LogManager.getFormatterLogger(TaskExecutor.class.getSimpleName() + ' ' + p_name);
m_name = p_name;
m_executor = Executors.newFixedThreadPool(p_threads, new ExecutorThreadFactory());
}