本文整理汇总了Java中org.apache.logging.log4j.status.StatusLogger.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Java StatusLogger.getLogger方法的具体用法?Java StatusLogger.getLogger怎么用?Java StatusLogger.getLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.logging.log4j.status.StatusLogger
的用法示例。
在下文中一共展示了StatusLogger.getLogger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readObject
import org.apache.logging.log4j.status.StatusLogger; //导入方法依赖的package包/类
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
formattedMessage = in.readUTF();
messagePattern = in.readUTF();
bundleId = in.readUTF();
final int length = in.readInt();
stringArgs = new String[length];
for (int i = 0; i < length; ++i) {
stringArgs[i] = in.readUTF();
}
logger = StatusLogger.getLogger();
bundle = null;
argArray = null;
}
示例2: readObject
import org.apache.logging.log4j.status.StatusLogger; //导入方法依赖的package包/类
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
formattedMessage = in.readUTF();
key = in.readUTF();
baseName = in.readUTF();
in.readInt();
stringArgs = (String[]) in.readObject();
logger = StatusLogger.getLogger();
resourceBundle = null;
argArray = null;
}
示例3: removeListeners
import org.apache.logging.log4j.status.StatusLogger; //导入方法依赖的package包/类
/**
* Add listener to StatusLogger for this context, or replace it if it already exists.
*
* @param ctxName
*/
private void removeListeners(final String ctxName) {
final StatusLogger logger = StatusLogger.getLogger();
final Iterable<StatusListener> listeners = logger.getListeners();
// Remove any StatusLoggerAdmin listeners already registered for this context
for (final StatusListener statusListener : listeners) {
if (statusListener instanceof StatusLoggerAdmin) {
final StatusLoggerAdmin adminListener = (StatusLoggerAdmin) statusListener;
if (ctxName != null && ctxName.equals(adminListener.contextName)) {
logger.removeListener(adminListener);
}
}
}
}
示例4: logger
import org.apache.logging.log4j.status.StatusLogger; //导入方法依赖的package包/类
private static StatusLogger logger() {
return StatusLogger.getLogger();
}