org.seasar.framework.log.Logger.error()方法的使用及代码示例

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

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

Logger.error介绍

[英]ERROR情報を出力します。
[中]错误情報を出力します。

代码示例

代码示例来源:origin: org.seasar.buri/s2-buri

  1. protected void compileProcessError(String src,Object baseObj,Location location,String message) {
  2. logger.error(location);
  3. logger.error(message);
  4. logger.error(src);
  5. }

代码示例来源:origin: net.arnx/jsonic

  1. @Override
  2. public void error(String message, Throwable e) {
  3. if (e != null) {
  4. log.error(message, e);
  5. } else {
  6. log.error(message);
  7. }
  8. }
  9. }

代码示例来源:origin: org.seasar.container/s2-framework

  1. /**
  2. * ログを出力します。
  3. *
  4. * @param throwable
  5. */
  6. public final void log(Throwable throwable) {
  7. error(throwable.getMessage(), throwable);
  8. }

代码示例来源:origin: com.github.ns2j/nos2jdbc-util

  1. /**
  2. * ログを出力します。
  3. *
  4. * @param throwable
  5. */
  6. public final void log(Throwable throwable) {
  7. error(throwable.getMessage(), throwable);
  8. }

代码示例来源:origin: org.seasar.chronos/s2chronos-core

  1. /**
  2. * Futureオブジェクトを待機します.
  3. *
  4. * @param future
  5. * Future
  6. */
  7. private void waitFuture(Future<?> future) {
  8. if (!async) {
  9. try {
  10. future.get();
  11. } catch (InterruptedException e) {
  12. } catch (ExecutionException e) {
  13. log.error("実行例外が発生しました", e);
  14. }
  15. }
  16. }

代码示例来源:origin: org.seasar.teeda/teeda-core

  1. public static Integer coerceToInteger(Object index, Logger logger) {
  2. try {
  3. return Coercions.coerceToInteger(index, logger);
  4. } catch (ELException e) {
  5. logger_.error(e + " occured at " + CoercionsUtil.class);
  6. return null;
  7. }
  8. }

代码示例来源:origin: org.seasar.jms/s2jms-core

  1. @Override
  2. protected synchronized void eval(final StringWriter out) throws Exception {
  3. boolean succeeded = velocityEngine.evaluate(context, out, "", templateText);
  4. if (!succeeded) {
  5. logger.error("Failed to evaluate velocity template text: " + templateText);
  6. }
  7. }

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-core

  1. public DirectoryServiceImpl(Hashtable environment, Properties props){
  2. this.environment = environment;
  3. this.props = props;
  4. try{
  5. initialize();
  6. }catch(NamingException ne){
  7. log.error("startup failed, check config/directory.dicon.");
  8. throw new RuntimeException(ne);
  9. }
  10. }

代码示例来源:origin: org.seasar.cms.ymir/ymir

  1. void destroyListeners() {
  2. if (lifecycleListeners_ != null) {
  3. for (int i = 0; i < lifecycleListeners_.length; i++) {
  4. try {
  5. lifecycleListeners_[i].destroy();
  6. } catch (Throwable t) {
  7. logger_.error("Can't destroy lifecycleListener: "
  8. + lifecycleListeners_[i], t);
  9. }
  10. }
  11. lifecycleListeners_ = null;
  12. }
  13. }

代码示例来源:origin: org.seasar.buri/s2-buri

  1. private static Workbook getWorkbook(InputStream is) {
  2. Workbook workbook = null;
  3. try {
  4. workbook = Workbook.getWorkbook(is);
  5. } catch (BiffException e) {
  6. logger.error(e);
  7. } catch (IOException e) {
  8. throw new IORuntimeException(e);
  9. }
  10. return workbook;
  11. }

代码示例来源:origin: org.seasar.portlet/s2-portlet

  1. public void destroy() {
  2. try {
  3. getGenericPortlet().destroy();
  4. } catch (PortletException e) {
  5. logger.error(e);
  6. }
  7. // do not destroy S2Container because S2Container is shared.
  8. // SingletonS2ContainerFactory.destroy();
  9. }

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-core

  1. public TgwUser getUser(String userdn){
  2. TgwUser user = null;
  3. try{
  4. ctx = new InitialDirContext(environment);
  5. Attributes attrs = ctx.getAttributes(DirectoryUtils.getRDN(userdn,searchBase));
  6. user = createUser(userdn,attrs);
  7. // ctx.close();
  8. }catch(NamingException ne){
  9. log.error(ne.getMessage());
  10. // ne.printStackTrace();
  11. }finally{
  12. DirectoryUtils.closeQuietly(ctx);
  13. }
  14. return user;
  15. }

代码示例来源:origin: org.seasar.container/s2-framework

  1. public Object invoke(MethodInvocation invocation) throws Throwable {
  2. Class targetClass = getTargetClass(invocation);
  3. if (logger.isDebugEnabled()) {
  4. String methodName = invocation.getMethod().getName();
  5. logger.debug("[ToStringInterceptor] modifying "
  6. + targetClass.getName() + "#" + methodName);
  7. }
  8. try {
  9. return toString(targetClass, invocation.getThis());
  10. } catch (Exception e) {
  11. logger.error("[ToStringInterceptor] modify failed", e);
  12. return invocation.proceed();
  13. }
  14. }

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-core

  1. public TgwRole getRole(String roledn){
  2. TgwRole role = null;
  3. try{
  4. ctx = new InitialDirContext(environment);
  5. Attributes attrs = ctx.getAttributes(DirectoryUtils.getRDN(roledn,searchBase));
  6. role = createRole(roledn,attrs);
  7. // ctx.close();
  8. }catch(NamingException ne){
  9. log.error(ne.getMessage());
  10. // ne.printStackTrace();
  11. }finally{
  12. DirectoryUtils.closeQuietly(ctx);
  13. }
  14. return role;
  15. }

代码示例来源:origin: org.seasar.struts/s2-struts

  1. protected void initChain() throws ServletException {
  2. // Parse the configuration file specified by path or resource
  3. try {
  4. String value;
  5. value = getServletConfig().getInitParameter("chainConfig");
  6. if (value != null) {
  7. chainConfig = value;
  8. }
  9. ConfigParser parser = new ConfigParser();
  10. List urls = splitAndResolvePaths(chainConfig);
  11. URL resource;
  12. for (Iterator i = urls.iterator(); i.hasNext();) {
  13. resource = (URL) i.next();
  14. log.info("Loading chain catalog from " + resource);
  15. parser.parse(resource);
  16. }
  17. } catch (Exception e) {
  18. log.error("Exception loading resources", e);
  19. throw new ServletException(e);
  20. }
  21. }

代码示例来源:origin: org.seasar.buri/s2-buri

  1. protected void processException(OgnlException e,String message,Object[] objs,Object expression,Object root,Map context) {
  2. String errInfo = ((e.getReason()!=null) ? "exception=" + e.getReason().toString() : "") + "\nexpression=" + expression + "\ncontext=" + context;
  3. logger.error(errInfo);
  4. if(e.getReason() instanceof RuntimeException) {
  5. throw (RuntimeException)e.getReason();
  6. }
  7. throw new BuriOGNLRuntimeException(message,objs,e);
  8. }

代码示例来源:origin: org.seasar.struts/s2-struts

  1. /**
  2. * <p>
  3. * Simplifies exception handling in the parseModuleConfigFile method.
  4. * <p>
  5. *
  6. * @param path
  7. * The path to which the exception relates.
  8. * @param e
  9. * The exception to be wrapped and thrown.
  10. * @throws UnavailableException
  11. * as a wrapper around Exception
  12. */
  13. private void handleConfigException(String path, Exception e) throws UnavailableException {
  14. String msg = getActionServlet().getInternal().getMessage("configParse", path);
  15. log.error(msg, e);
  16. throw new UnavailableException(msg);
  17. }

代码示例来源:origin: org.seasar.struts/s2-struts

  1. /**
  2. * <p>
  3. * Handle errors related to creating an instance of the specified class.
  4. * </p>
  5. *
  6. * @param className
  7. * The className that could not be instantiated.
  8. * @param e
  9. * The exception that was caught.
  10. * @throws ServletException
  11. * to communicate the error.
  12. */
  13. private void handleCreationException(String className, Exception e) throws ServletException {
  14. String errorMessage = getActionServlet().getInternal().getMessage("configExtends.creation", className);
  15. log.error(errorMessage, e);
  16. throw new UnavailableException(errorMessage);
  17. }

代码示例来源:origin: org.seasar.struts/s2-struts

  1. /**
  2. * <p>
  3. * General handling for exceptions caught while inheriting config
  4. * information.
  5. * </p>
  6. *
  7. * @param configType
  8. * The type of configuration object of configName.
  9. * @param configName
  10. * The name of the config that could not be extended.
  11. * @param e
  12. * The exception that was caught.
  13. * @throws ServletException
  14. * to communicate the error.
  15. */
  16. private void handleGeneralExtensionException(String configType, String configName, Exception e)
  17. throws ServletException {
  18. String errorMessage = getActionServlet().getInternal().getMessage("configExtends", configType, configName);
  19. log.error(errorMessage, e);
  20. throw new UnavailableException(errorMessage);
  21. }

代码示例来源:origin: org.seasar.tuigwaa/tuigwaa-core

  1. private void updateRoles(TgwUser user, String[] roles, int mod_op) throws NamingException{
  2. if(roles != null){
  3. Attributes member = null;
  4. if(prefixOnly){
  5. member = new BasicAttributes(roleUserAttribute,user.getName());
  6. }else{
  7. member = new BasicAttributes(roleUserAttribute,user.getDn());
  8. }
  9. for(int i=0;i<roles.length;i++){
  10. if(roles[i] != null){ // in-case modifying admin user contains admin role, see modifyUser
  11. String roledn = DirectoryUtils.getAbsoluteDN(roles[i],rolePrefix,roleSuffix,searchBase);
  12. try{
  13. ctx.modifyAttributes(DirectoryUtils.getRDN(roledn,searchBase),mod_op,member);
  14. }catch(NamingException ne){
  15. log.error("update failed for " + roledn);
  16. continue;
  17. }
  18. }
  19. }
  20. }
  21. }

相关文章