org.teiid.logging.LogManager.logWarning()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.teiid.logging.LogManager.logWarning()方法的一些代码示例,展示了LogManager.logWarning()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogManager.logWarning()方法的具体详情如下:
包路径:org.teiid.logging.LogManager
类名称:LogManager
方法名:logWarning

LogManager.logWarning介绍

[英]Send a warning message to the log. Warning messages generally described expected errors from which the system should recover. However, this level is used to record the fact that such an error or event did occur.

Only if the log manager is configured to send such messages to the destination will the message be recorded.
[中]向日志发送警告消息。警告消息通常描述系统应该从中恢复的预期错误。但是,该级别用于记录此类错误或事件确实发生的事实。
只有将日志管理器配置为将此类消息发送到目标时,才会记录该消息。

代码示例

代码示例来源:origin: teiid/teiid

  1. protected void logWaitMessage(long warnTime, int maximumPoolSize, String poolName, int highestQueueSize) {
  2. LogManager.logWarning(LogConstants.CTX_RUNTIME, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30009, maximumPoolSize, poolName, highestQueueSize, warnTime));
  3. }

代码示例来源:origin: org.teiid/teiid-engine

  1. protected void logWaitMessage(long warnTime, int maximumPoolSize, String poolName, int highestQueueSize) {
  2. LogManager.logWarning(LogConstants.CTX_RUNTIME, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30009, maximumPoolSize, poolName, highestQueueSize, warnTime));
  3. }

代码示例来源:origin: org.teiid/teiid-engine

  1. private boolean addLibrary(String className, String prefix) {
  2. try {
  3. Class<?> osdqFunctions = Class.forName(className, false,
  4. this.getClass().getClassLoader());
  5. addFunctions(osdqFunctions, prefix);
  6. return true;
  7. } catch (ClassNotFoundException|NoClassDefFoundError e) {
  8. // ignore the add
  9. LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  10. }
  11. return false;
  12. }

代码示例来源:origin: teiid/teiid

  1. private boolean addLibrary(String className, String prefix) {
  2. try {
  3. Class<?> osdqFunctions = Class.forName(className, false,
  4. this.getClass().getClassLoader());
  5. addFunctions(osdqFunctions, prefix);
  6. return true;
  7. } catch (ClassNotFoundException|NoClassDefFoundError e) {
  8. // ignore the add
  9. LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  10. }
  11. return false;
  12. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. private boolean addLibrary(String className, String prefix) {
  2. try {
  3. Class<?> osdqFunctions = Class.forName(className, false,
  4. this.getClass().getClassLoader());
  5. addFunctions(osdqFunctions, prefix);
  6. return true;
  7. } catch (ClassNotFoundException|NoClassDefFoundError e) {
  8. // ignore the add
  9. LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31263, className, e.getMessage()));
  10. }
  11. return false;
  12. }

代码示例来源:origin: org.teiid/teiid-runtime

  1. private void logProcessingException(Throwable e, String context) {
  2. Throwable cause = e;
  3. while (cause.getCause() != null && cause != cause.getCause()) {
  4. cause = cause.getCause();
  5. }
  6. StackTraceElement elem = cause.getStackTrace()[0];
  7. String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40011, e.getMessage(), this.socketClientInstance.getWorkContext().getSessionId(), e.getClass().getName(), elem);
  8. if (LogManager.isMessageToBeRecorded(context, MessageLevel.DETAIL)) {
  9. LogManager.logWarning(context, e, msg);
  10. } else {
  11. LogManager.logWarning(context, msg + QueryPlugin.Util.getString("stack_info")); ////$NON-NLS-1$
  12. }
  13. }
  14. }

代码示例来源:origin: org.teiid/teiid-runtime

  1. public int resetPendingJob(final VDBMetaData vdb, final Table table, String nodeName){
  2. try {
  3. String statusTable = table.getProperty(MaterializationMetadataRepository.MATVIEW_STATUS_TABLE, false);
  4. String updateStatusTable = "UPDATE "+statusTable+" SET LOADSTATE='NEEDS_LOADING' "
  5. + "WHERE LOADSTATE = 'LOADING' AND NODENAME = '"+nodeName+"' "
  6. + "AND NAME = '"+table.getName()+"'";
  7. List<Map<String, String>> results = executeQuery(vdb, updateStatusTable);
  8. String count = results.get(0).get("update-count");
  9. return Integer.parseInt(count);
  10. } catch (SQLException e) {
  11. LogManager.logWarning(LogConstants.CTX_MATVIEWS, e, e.getMessage());
  12. }
  13. return 0;
  14. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. @Override
  2. public void release() {
  3. try {
  4. requestCancel();
  5. } catch (TeiidComponentException e) {
  6. LogManager.logWarning(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30026,requestID));
  7. }
  8. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. public String toString() {
  2. try{
  3. return "XMLPlan:\n" + ProgramUtil.programToString(this.originalProgram); //$NON-NLS-1$
  4. } catch (Exception e){
  5. LogManager.logWarning(LogConstants.CTX_XML_PLAN, e, QueryPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
  6. }
  7. return "XMLPlan"; //$NON-NLS-1$
  8. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. @Override
  2. public void run() {
  3. int count = runs.incrementAndGet();
  4. try {
  5. defrag(false);
  6. if ((count%truncateInterval)==0) {
  7. truncate(false);
  8. }
  9. } catch (Throwable t) {
  10. LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  11. } finally {
  12. defragRunning.set(false);
  13. }
  14. }

代码示例来源:origin: teiid/teiid

  1. @Override
  2. public void run() {
  3. int count = runs.incrementAndGet();
  4. try {
  5. defrag(false);
  6. if ((count%truncateInterval)==0) {
  7. truncate(false);
  8. }
  9. } catch (Throwable t) {
  10. LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  11. } finally {
  12. defragRunning.set(false);
  13. }
  14. }

代码示例来源:origin: org.teiid/teiid-engine

  1. @Override
  2. public void run() {
  3. int count = runs.incrementAndGet();
  4. try {
  5. defrag(false);
  6. if ((count%truncateInterval)==0) {
  7. truncate(false);
  8. }
  9. } catch (Throwable t) {
  10. LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
  11. } finally {
  12. defragRunning.set(false);
  13. }
  14. }

代码示例来源:origin: org.teiid/teiid-runtime

  1. public void setEncoding(String value, boolean init) {
  2. if (value == null || value.equals(this.clientEncoding)) {
  3. return;
  4. }
  5. this.clientEncoding = value;
  6. Charset cs = PGCharsetConverter.getCharset(value);
  7. if (cs != null) {
  8. this.encoding = cs;
  9. if (!init) {
  10. sendParameterStatus(CLIENT_ENCODING, value);
  11. }
  12. } else {
  13. LogManager.logWarning(LogConstants.CTX_ODBC, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40105, value));
  14. }
  15. }

代码示例来源:origin: org.teiid.connectors/translator-ldap

  1. public void close() {
  2. try {
  3. if(ldapCtx != null) {
  4. ldapCtx.close();
  5. }
  6. } catch (NamingException ne) {
  7. LogManager.logWarning(LogConstants.CTX_CONNECTOR, LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12003, ne.getExplanation()));
  8. }
  9. }

代码示例来源:origin: org.jboss.teiid/teiid-engine

  1. private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  2. if (!supports) {
  3. return;
  4. }
  5. for (Capability capability : required) {
  6. if (!tgtCaps.supportsCapability(capability)) {
  7. LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
  8. supports = false;
  9. }
  10. }
  11. tgtCaps.setCapabilitySupport(cap, supports);
  12. }

代码示例来源:origin: org.teiid/teiid-engine

  1. private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  2. if (!supports) {
  3. return;
  4. }
  5. for (Capability capability : required) {
  6. if (!tgtCaps.supportsCapability(capability)) {
  7. LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
  8. supports = false;
  9. }
  10. }
  11. tgtCaps.setCapabilitySupport(cap, supports);
  12. }

代码示例来源:origin: teiid/teiid

  1. private static void setSupports(Object connectorID, BasicSourceCapabilities tgtCaps, Capability cap, boolean supports, Capability... required) {
  2. if (!supports) {
  3. return;
  4. }
  5. for (Capability capability : required) {
  6. if (!tgtCaps.supportsCapability(capability)) {
  7. LogManager.logWarning(LogConstants.CTX_CONNECTOR, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
  8. supports = false;
  9. }
  10. }
  11. tgtCaps.setCapabilitySupport(cap, supports);
  12. }

代码示例来源:origin: org.teiid/teiid-olingo

  1. @Override
  2. public void doFilter(ServletRequest request, ServletResponse response,
  3. FilterChain chain) throws IOException, ServletException {
  4. try {
  5. internalDoFilter(request, response, chain);
  6. } catch (TeiidProcessingException e) {
  7. //TODO: use engine style logic to determine if the stack should be logged
  8. LogManager.logWarning(LogConstants.CTX_ODATA, e, ODataPlugin.Util.gs(ODataPlugin.Event.TEIID16047, e.getMessage()));
  9. HttpServletResponse httpResponse = (HttpServletResponse)response;
  10. writeError(request, e, httpResponse, 404);
  11. }
  12. }

代码示例来源:origin: org.teiid/teiid-runtime

  1. public synchronized void registerBeans() {
  2. try {
  3. register(new Teiid(dqp, sessionService, bufferService), TEIID);
  4. register(new Cache(dqp.getPrepPlanCache()),
  5. CACHE_PREFIX + "PreparedPlan"); //$NON-NLS-1$
  6. register(new Cache(dqp.getResltSetCache()),
  7. CACHE_PREFIX + "ResultSet"); //$NON-NLS-1$
  8. } catch (MBeanRegistrationException | OperationsException e) {
  9. LogManager.logWarning(LogConstants.CTX_RUNTIME, e,
  10. "JMX Registration Exception - it's likely another Teiid instance is running in this VM"); //$NON-NLS-1$
  11. }
  12. }

代码示例来源:origin: org.teiid/teiid-runtime

  1. private void sendErrorResponse(String message) {
  2. LogManager.logWarning(LogConstants.CTX_ODBC, message); //$NON-NLS-1$
  3. startMessage('E');
  4. write('S');
  5. writeString("ERROR");
  6. write('C');
  7. // PROTOCOL VIOLATION
  8. writeString("08P01");
  9. write('M');
  10. writeString(message);
  11. write(0);
  12. sendMessage();
  13. }

相关文章