Example usage for org.apache.commons.logging LogFactory getLog

List of usage examples for org.apache.commons.logging LogFactory getLog

Introduction

In this page you can find the example usage for org.apache.commons.logging LogFactory getLog.

Prototype

public static Log getLog(String name) 

Source Link

Document

Convenience method to return a named logger.

Usage

From source file:com.cloudera.sqoop.testutil.LobAvroImportTestCase.java

public LobAvroImportTestCase() {
    this.log = LogFactory.getLog(LobAvroImportTestCase.class.getName());
}

From source file:dk.netarkivet.common.utils.batch.GoodPostProcessingJob.java

@Override
public boolean postProcess(InputStream input, OutputStream output) {
    Log log = LogFactory.getLog(this.getClass());
    try {/*from   w ww.  java  2 s  .co  m*/
        // sort the input stream.
        List<String> filenames = new ArrayList<String>();

        log.info("Reading all the filenames.");
        // read all the filenames.
        BufferedReader br = new BufferedReader(new InputStreamReader(input));
        String line;
        while ((line = br.readLine()) != null) {
            filenames.add(line);
        }

        log.info("Sorting the filenames");
        // sort and print to output.
        Collections.sort(filenames);
        for (String file : filenames) {
            output.write(file.getBytes());
            output.write("\n".getBytes());
        }

        return true;
    } catch (Exception e) {
        log.warn(e.getMessage());
        return false;
    }
}

From source file:com.curl.orb.servlet.DestroyInstanceServlet.java

@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    super.doPost(request, response);
    Log log = LogFactory.getLog(getClass());
    DestroyInstanceRequest destroyInstanceRequest = (DestroyInstanceRequest) InstanceManagementUtil
            .getRequest(request);//from  w w w  .jav  a2 s  . co m
    try {
        HttpSession session = request.getSession(false);
        if (session == null)
            throw new InstanceManagementException("Does not exist HttpSession.");
        String objectId = destroyInstanceRequest.getObjectId();
        Object obj = session.getAttribute(objectId);
        // security
        RemoteServiceAnnotationChecker.check(obj.getClass(), environment);
        // remove the object from session
        session.removeAttribute(objectId);

        // kill session
        if (destroyInstanceRequest.getHeader() != null
                && destroyInstanceRequest.getHeader().containsKey(KILL_SESSION)
                && (Boolean) destroyInstanceRequest.getHeader().get(KILL_SESSION)) {
            log.debug("Killed HttpSession:" + session.getId());
            session.invalidate();
        }
        InstanceManagementUtil.setResponse(request, null, null);
        log.debug("Request destroyed");
    }
    // IOException, SerializerException, InstanceManagementException
    catch (Exception e) {
        InstanceManagementUtil.setResponse(request, e, null);
    }
}

From source file:com.alfaariss.oa.authorization.action.AbstractAction.java

/**
 * Default constructor
 */
public AbstractAction() {
    _logger = LogFactory.getLog(AbstractAction.class);
    _bIsEnabled = false;
}

From source file:com.jpeterson.littles3.service.impl.FileStorageServiceImpl.java

public FileStorageServiceImpl() {
    logger = LogFactory.getLog(this.getClass());
}

From source file:com.curl.orb.servlet.InvokeApplicationContextServlet.java

@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    super.doPost(request, response);
    Log log = LogFactory.getLog(getClass());
    InvokeApplicationContextRequest invokeRequest = (InvokeApplicationContextRequest) InstanceManagementUtil
            .getRequest(request);/*from   w w  w .j a v a  2s .co m*/
    try {
        String className = invokeRequest.getClassName(); // context's object name
        String methodName = invokeRequest.getMethodName();
        Object[] arguments = invokeRequest.getArguments();

        AbstractApplicationContext applicationContext = ApplicationContextFactory
                .getInstance(getServletContext()).getApplicationContext();
        Object obj = applicationContext.getObject(className);
        if (obj == null)
            throw new InstanceManagementException("This object does not exsit [" + className + "]");
        // security
        RemoteServiceAnnotationChecker.check(applicationContext.getProperType(obj), environment);
        Method method = InstanceManagementUtil.getMethod(obj, methodName, arguments);
        InstanceManagementUtil.setResponse(request, InstanceManagementUtil.invokeMethod(method, obj, arguments),
                InstanceManagementUtil.getSurborinateObject(method));
        // debug
        log.debug("Request invoke method(DI Container)");
    }
    // IOException, SerializerException, ApplicationContextException, InstanceManagementException ...
    catch (Exception e) {
        InstanceManagementUtil.setResponse(request, e, null);
    }
}

From source file:com.alfaariss.oa.engine.authorization.jdbc.JDBCMethod.java

/**
 * Creates a method object./*w w w. j a v a2  s.  com*/
 * 
 * @param oResultSet
 * @throws AuthorizationException
 */
public JDBCMethod(ResultSet oResultSet) throws AuthorizationException {
    super();
    try {
        _logger = LogFactory.getLog(JDBCMethod.class);
        _sID = oResultSet.getString(COLUMN_METHOD_ID);
    } catch (Exception e) {
        _logger.fatal("Internal error during initialization", e);
        throw new AuthorizationException(SystemErrors.ERROR_INTERNAL);
    }
}

From source file:com.alfaariss.oa.engine.authentication.configuration.ConfigurationFactory.java

/**
 * Creates the object. /*w  w w . j a v a 2 s  . c  om*/
 */
public ConfigurationFactory() {
    _logger = LogFactory.getLog(ConfigurationFactory.class);
    _mapAuthenticationProfiles = new HashMap<String, AuthenticationProfile>();
}

From source file:es.tunelator.log.Logger.java

/**
 * @param source//w w  w .j a va2  s  .com
 * @param msg
 */
public static void logFatal(Class source, String msg) {
    Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_FATAL);
    //        Log log = LogFactory.getLog(source);
    log.error(msg);
}

From source file:net.sf.j2ep.rules.RewriteRule.java

/**
 * Basic constructor.
 */
public RewriteRule() {
    isRewriting = false;
    log = LogFactory.getLog(RewriteRule.class);
}