Package org.slf4j

Examples of org.slf4j.Logger.error()


    public static void error( IoSession session, String message, Throwable cause )
    {
        Logger log = getLogger( session );
        if( log.isErrorEnabled() )
        {
            log.error( String.valueOf( session.getAttribute( PREFIX ) ) + message, cause );
        }
    }
   
    public static boolean isDebugEnabled( IoSession session )
    {
View Full Code Here


                final JobContext jobCtx = new JobContextImpl(name, configuration);
                ((org.apache.sling.commons.scheduler.Job) job).execute(jobCtx);
            } else if (job instanceof Runnable) {
                ((Runnable) job).run();
            } else {
                logger.error("Scheduled job {} is neither a job nor a runnable.", job);
            }
        } catch (final Throwable t) {
            // if this is a quartz exception, rethrow it
            if (t instanceof JobExecutionException) {
                throw (JobExecutionException) t;
View Full Code Here

            // if this is a quartz exception, rethrow it
            if (t instanceof JobExecutionException) {
                throw (JobExecutionException) t;
            }
            // there is nothing we can do here, so we just log
            logger.error("Exception during job execution of " + job + " : " + t.getMessage(), t);
        } finally {
            if (!canRunConcurrently) {
                concurrentHandler.isRunning = false;
            }
        }
View Full Code Here

                break;
            case LogService.LOG_WARNING:
                log.warn(message, exception);
                break;
            case LogService.LOG_ERROR:
                log.error(message, exception);
                break;
            default:
                if (logEntry.getLevel() > LogService.LOG_DEBUG) {
                    log.trace(message, exception);
                } else if (logEntry.getLevel() < LogService.LOG_ERROR) {
View Full Code Here

                break;
            default:
                if (logEntry.getLevel() > LogService.LOG_DEBUG) {
                    log.trace(message, exception);
                } else if (logEntry.getLevel() < LogService.LOG_ERROR) {
                    log.error(message, exception);
                }
                break;
        }
    }
View Full Code Here

              // Run the user's code
              code.run(getLog());
            }
            catch (Exception e)
            {
              log.error("Unhandled exception thrown by user code in task "
                  + name, e);
            }
           
            if (log.isDebugEnabled())
            {
View Full Code Here

                // Run the user's code
                code.run(getLog());
              }
              catch (Exception e)
              {
                log.error(
                  "Unhandled exception thrown by user code in task " + name, e);
              }

              if (log.isTraceEnabled())
              {
View Full Code Here

              startOfPeriod.add(frequency).fromNow().sleep();
            }
          }
          catch (Throwable t)
          {
            log.error("Task " + name + " terminated", t);
          }
          finally
          {
            isStarted = false;
          }
View Full Code Here

        log.trace("trace message");
        log.debug("debug message");
        log.info("info message");
        log.warn("warn message");
        log.error("error message");
    }
}
View Full Code Here

        Session session = mockSession();
        Logger logger = mockLogger();

        expect(session.get(SampleEntity.class, new Long(12345))).andReturn(null);

        logger.error("Unable to convert client value '12345' into an entity instance.");

        replay();

        RootClass persistentClass = new RootClass();
        Property idProperty = new Property();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.