congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FileLogManager
Code IndexAdd Tabnine to your IDE (free)

How to use
FileLogManager
in
com.norconex.jef4.log

Best Java code snippets using com.norconex.jef4.log.FileLogManager (Showing top 8 results out of 315)

origin: com.norconex.jef/norconex-jef

private ILogManager resolveLogManager(ILogManager configLogManager) {
  ILogManager lm = configLogManager;
  if (lm == null) {
    lm = new FileLogManager(workdir);
  }
  LOG.info("JEF log manager is : "
      + lm.getClass().getSimpleName());
  return lm;
}
private IJobStatusStore resolveJobStatusStore(
origin: com.norconex.jef/norconex-jef

@Override
public InputStream getLog(String suiteId, String jobId) throws IOException {
  if (jobId == null) {
    return getLog(suiteId);
  }
  InputStream fullLog = getLog(suiteId);
  if (fullLog != null) {
    return new FilteredInputStream(
        getLog(suiteId), new StartWithFilter(jobId));
  }
  return null;
}
origin: com.norconex.jef/norconex-jef

@Override
public final InputStream getLog(final String suiteId) throws IOException {
  File logFile = getLogFile(suiteId);
  if (logFile != null && logFile.exists()) {
    return new FileInputStream(logFile);
  }
  return null;
}
@Override
origin: com.norconex.jef/norconex-jef

@Override
public final void backup(final String suiteId, final Date backupDate)
    throws IOException {
  resolveDirsIfNeeded();
  String date = new SimpleDateFormat(
      "yyyyMMddHHmmssSSSS").format(backupDate);
  File progressFile = getLogFile(suiteId);
  
  File backupDir = FileUtil.createDateDirs(
      new File(logdirBackupBase), backupDate);
  backupDir = new File(backupDir, "logs");
  if (!backupDir.exists()) {
    try {
      FileUtils.forceMkdir(backupDir);
    } catch (IOException e) {
      throw new JEFException("Cannot create backup directory: "
          + backupDir, e);
    }
  }        
  File backupFile = new File(
      backupDir + "/" + date + "__" 
          + FileUtil.toSafeFileName(suiteId) + LOG_SUFFIX);
  if (progressFile.exists()) {
    FileUtil.moveFile(progressFile, backupFile);
  }
}
origin: com.norconex.jef/norconex-jef

/**
 * Gets the log file used by this log manager.
 * @param suiteId log file suiteId
 * @return log file
 */
public File getLogFile(final String suiteId) {
  if (suiteId == null) {
    return null;
  }
  resolveDirsIfNeeded();
  return new File(logdirLatest + "/" 
      + FileUtil.toSafeFileName(suiteId) + LOG_SUFFIX);
}
 
origin: com.norconex.jef/norconex-jef

@Override
public void loadFromXML(Reader in) throws IOException {
  XMLConfiguration xml = XMLConfigurationUtil.newXMLConfiguration(in);
  setLogDirectory(xml.getString("logDir", logdir));
}
origin: com.norconex.jef/norconex-jef

@Override
public final Appender createAppender(final String suiteId)
    throws IOException {
  resolveDirsIfNeeded();
  return new FileAppender(new PatternLayout(LAYOUT_PATTERN),
      logdirLatest + "/" + 
          FileUtil.toSafeFileName(suiteId) + LOG_SUFFIX);
}
 
origin: com.norconex.collectors/norconex-collector-core

suiteConfig.setLogManager(new FileLogManager(collConfig.getLogsDir()));
suiteConfig.setJobStatusStore(
    new FileJobStatusStore(collConfig.getProgressDir()));
com.norconex.jef4.logFileLogManager

Javadoc

Log manager using the file system to store its logs. When no log directory is explicitly set, it defaults to: <user.home>/Norconex/jef/workdir

XML configuration usage:

 
<logManager class="com.norconex.jef4.log.FileLogManager"> 
<logDir>(directory where to store logs)</logDir> 
</logManager> 

Usage example:

The following example indicates logs should be stored in this directory: /tmp/jeflogs

 
<logManager class="com.norconex.jef4.log.FileLogManager"> 
<logDir>/tmp/jeflogs</logDir> 
</logManager> 

Most used methods

  • <init>
    Creates a new FileLogManager, wrapping the given layout into a ThreadSafeLayout.
  • getLog
  • getLogFile
    Gets the log file used by this log manager.
  • resolveDirsIfNeeded
  • setLogDirectory

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • putExtra (Intent)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JOptionPane (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now