本文整理了Java中org.teiid.logging.LogManager.logInfo()
方法的一些代码示例,展示了LogManager.logInfo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogManager.logInfo()
方法的具体详情如下:
包路径:org.teiid.logging.LogManager
类名称:LogManager
方法名:logInfo
[英]Send a information message to the log. This level of logging is the usually the normal level. All interesting periodic events should be logged at this level so someone looking through the log can see the amount and kind of processing happening in the system.
Only if the log manager is configured to send such messages to the destination will the message be recorded.
[中]向日志发送信息消息。此日志记录级别通常是正常级别。所有感兴趣的周期性事件都应该记录在这个级别,以便查看日志的人可以看到系统中发生的处理量和类型。
只有将日志管理器配置为将此类消息发送到目标时,才会记录该消息。
代码示例来源:origin: teiid/teiid
private String checkForDuplicate(String name, Function<String, Boolean> check, String type) {
if (check.apply(name)) {
int suffix = 1;
String newName = name + "_" + suffix; //$NON-NLS-1$
while (check.apply(newName)) {
suffix++;
newName = name + "_" + suffix; //$NON-NLS-1$
}
LogManager.logInfo(LogConstants.CTX_CONNECTOR, DataPlugin.Util.gs(DataPlugin.Event.TEIID60039, name, newName, type));
name = newName;
}
return name;
}
代码示例来源:origin: org.teiid/teiid-runtime
private void notifyAdd(String name, String version, CompositeVDB vdb) {
LogManager.logInfo(LIFECYCLE_CONTEXT, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40118,name, version));
for(VDBLifeCycleListener l:this.listeners) {
l.added(name, vdb);
}
}
代码示例来源:origin: org.teiid/teiid-runtime
private void notifyRemove(String name, String version, CompositeVDB vdb) {
LogManager.logInfo(LIFECYCLE_CONTEXT, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40119,name, version));
for(VDBLifeCycleListener l:this.listeners) {
l.removed(name, vdb);
}
}
代码示例来源:origin: org.teiid/teiid-runtime
private void notifyBeforeRemove(String name, String version, CompositeVDB vdb) {
LogManager.logInfo(LIFECYCLE_CONTEXT, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40120,name, version));
for(VDBLifeCycleListener l:this.listeners) {
l.beforeRemove(name, vdb);
}
}
代码示例来源:origin: teiid/teiid
public void addWarning(Exception warning) {
if (warning == null) {
return;
}
synchronized (this.globalState) {
if (globalState.warnings == null) {
globalState.warnings = new ArrayList<Exception>(1);
}
globalState.warnings.add(warning);
if (globalState.warnings.size() > MAX_WARNINGS) {
globalState.warnings.remove(0);
}
}
if (!this.getOptions().isSanitizeMessages() || LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31105, warning.getMessage()));
}
}
代码示例来源:origin: org.teiid/teiid-engine
public void addWarning(Exception warning) {
if (warning == null) {
return;
}
synchronized (this.globalState) {
if (globalState.warnings == null) {
globalState.warnings = new ArrayList<Exception>(1);
}
globalState.warnings.add(warning);
if (globalState.warnings.size() > MAX_WARNINGS) {
globalState.warnings.remove(0);
}
}
if (!this.getOptions().isSanitizeMessages() || LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31105, warning.getMessage()));
}
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
public void addWarning(Exception warning) {
if (warning == null) {
return;
}
synchronized (this.globalState) {
if (globalState.warnings == null) {
globalState.warnings = new ArrayList<Exception>(1);
}
globalState.warnings.add(warning);
}
if (!this.getOptions().isSanitizeMessages() || LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31105, warning.getMessage()));
}
}
代码示例来源:origin: org.teiid/teiid-runtime
private void updateVDB(List<Runnable> runnables, VDBMetaData vdb) {
if (!runnables.isEmpty()) {
//the task themselves will set the status on completion/failure
for (Runnable runnable : runnables) {
getExecutor().execute(runnable);
}
runnables.clear();
} else if (vdb.hasErrors()) {
LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(), vdb.getVersion(), vdb.getStatus()));
}
}
代码示例来源:origin: org.teiid/teiid-engine
@Override
public StorageMode getStorageMode() {
if (!saved) {
try {
getInputStream().close();
} catch (IOException e) {
CommandContext cc = CommandContext.getThreadLocalContext();
if (cc != null) {
cc.addWarning(e);
}
LogManager.logInfo(LogConstants.CTX_DQP, e.getMessage());
return StorageMode.FREE;
}
}
return fsisf.getStorageMode();
}
代码示例来源:origin: teiid/teiid
@Override
public StorageMode getStorageMode() {
if (!saved) {
try {
getInputStream().close();
} catch (IOException e) {
CommandContext cc = CommandContext.getThreadLocalContext();
if (cc != null) {
cc.addWarning(e);
}
LogManager.logInfo(LogConstants.CTX_DQP, e.getMessage());
return StorageMode.FREE;
}
}
return fsisf.getStorageMode();
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
@Override
public void run() {
try {
RequestWorkItem wi = workItemRef.get();
if (wi != null) {
LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, wi.requestID, finalTimeout));
wi.requestCancel();
}
} catch (TeiidComponentException e) {
LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018));
}
}
}, timeout));
代码示例来源:origin: org.teiid/teiid-runtime
@Override
public boolean terminateSession(String terminatedSessionID, String adminSessionID) {
Object[] params = {adminSessionID, terminatedSessionID};
LogManager.logInfo(LogConstants.CTX_SECURITY, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40009, params));
try {
closeSession(terminatedSessionID);
return true;
} catch (InvalidSessionException e) {
LogManager.logDetail(LogConstants.CTX_SECURITY,e,e.getMessage());
return false;
}
}
代码示例来源:origin: teiid/teiid
/**
* Test that all msgs logged are equal and output in same order.
*/
public void testLogMessage() throws Exception {
ListLogger cfg = (ListLogger)LogManager.logListener;
cfg.setLogLevel(CONTEXT, MessageLevel.INFO );
List<String> sentMsgList = new ArrayList<String>();
sentMsgList.add("A message 1"); //$NON-NLS-1$
sentMsgList.add("A message 2"); //$NON-NLS-1$
sentMsgList.add("A message 3"); //$NON-NLS-1$
sentMsgList.add("A message 4"); //$NON-NLS-1$
sentMsgList.add("A message 5"); //$NON-NLS-1$
sentMsgList.add("A message 6"); //$NON-NLS-1$
for (Iterator<String> iter = sentMsgList.iterator(); iter.hasNext();) {
String msg = iter.next();
LogManager.logInfo(CONTEXT, msg);
}
List<String> recevedMsgList = cfg.getLoggedMessages();
assertEquals(sentMsgList.size(), recevedMsgList.size());
assertEquals(sentMsgList, recevedMsgList);
}
代码示例来源:origin: org.teiid/teiid-runtime
private void notifyFinished(String name, String version, CompositeVDB v) {
LogManager.logInfo(LIFECYCLE_CONTEXT, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,name, version, v.getVDB().getStatus()));
VDBLifeCycleListener mm = null;
for(VDBLifeCycleListener l:this.listeners) {
if (l instanceof MaterializationManager) {
mm = l;
continue; //defer to last
}
l.finishedDeployment(name, v);
}
if (mm != null) {
mm.finishedDeployment(name, v);
}
}
代码示例来源:origin: org.teiid/teiid-runtime
private void monitorSessions() {
long currentTime = System.currentTimeMillis();
for (SessionMetadata info : sessionCache.values()) {
try {
if (CHECK_PING && !info.isEmbedded() && !info.isActive() && currentTime - info.getLastPingTime() > ServerConnection.PING_INTERVAL * 5) {
LogManager.logInfo(LogConstants.CTX_SECURITY, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40007, info.getSessionId()));
closeSession(info.getSessionId());
} else if (sessionExpirationTimeLimit > 0 && currentTime - info.getCreatedTime() > sessionExpirationTimeLimit) {
LogManager.logInfo(LogConstants.CTX_SECURITY,RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40008, info.getSessionId()));
closeSession(info.getSessionId());
}
} catch (Exception e) {
LogManager.logDetail(LogConstants.CTX_SECURITY, e, "error running session monitor, unable to monitor:", info.getSessionId()); //$NON-NLS-1$
}
}
}
代码示例来源:origin: org.teiid/teiid-runtime
void validateDataSources(VDBMetaData vdb) {
ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
for (ModelMetaData model:vdb.getModelMetaDatas().values()) {
if (model.isSource()) {
Collection<SourceMappingMetadata> mappings = model.getSourceMappings();
for (SourceMappingMetadata mapping:mappings) {
ConnectorManager cm = cmr.getConnectorManager(mapping.getName());
if (cm != null) {
String msg = cm.getStausMessage();
if (msg != null && msg.length() > 0) {
model.addRuntimeError(msg);
model.setMetadataStatus(Model.MetadataStatus.FAILED);
LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
}
}
}
}
}
}
代码示例来源:origin: teiid/teiid
@Override
public void closeSource() {
if (closed) {
return;
}
if (!errored && !success) {
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31153, tableName));
}
closed = true;
if (!success) {
globalStore.failedLoad(tableName);
table.remove();
}
if (qp != null) {
qp.closeProcessing();
}
super.closeSource();
}
};
代码示例来源:origin: org.teiid/teiid-engine
@Override
public void closeSource() {
if (closed) {
return;
}
if (!errored && !success) {
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31153, tableName));
}
closed = true;
if (!success) {
globalStore.failedLoad(tableName);
table.remove();
}
if (qp != null) {
qp.closeProcessing();
}
super.closeSource();
}
};
代码示例来源:origin: org.jboss.teiid/teiid-engine
@Override
public void closeSource() {
if (closed) {
return;
}
if (!errored && !success) {
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31153, tableName));
}
closed = true;
if (!success) {
globalStore.failedLoad(tableName);
table.remove();
}
if (qp != null) {
qp.closeProcessing();
}
super.closeSource();
}
};
代码示例来源:origin: org.teiid.connectors/translator-odata4
private void addActionImportAsProcedure(MetadataFactory mf, CsdlActionImport actionImport,
ODataType odataType, XMLMetadata metadata) throws TranslatorException {
List<CsdlAction> actions = getActions(metadata, actionImport.getAction());
for (CsdlAction action : actions) {
if (!hasComplexParameters(action.getParameters())) {
Procedure procedure = mf.addProcedure(action.getName());
addOperation(mf, metadata, odataType, action, procedure);
} else {
LogManager.logInfo(LogConstants.CTX_ODATA,
ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17033, action.getName()));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!