public List<SourceUnit> listLogsFilesByContainer(String containerId) throws ServiceException {
  List<SourceUnit> files=new ArrayList<>();
  try {
    String logDirectory=getLogDirectory(containerId);
    if (logDirectory.equalsIgnoreCase("stdout")) {
      files.add(new SourceUnit("stdout"));
      return files;
    }
    String containerName=dockerService.getContainerNameFromId(containerId);
    final String command="find " + logDirectory + " -type f ! -size 0 ";
    String execOutput=dockerService.execCommand(containerName,command);
    if (execOutput != null && execOutput.contains("cannot access") == false) {
      if (logger.isDebugEnabled()) {
        logger.debug(execOutput);
      }
      StringTokenizer lignes=new StringTokenizer(execOutput,"\n");
      while (lignes.hasMoreTokens()) {
        String name=lignes.nextToken();
        name=name.substring(name.lastIndexOf("/") + 1);
        SourceUnit sourceUnit=new SourceUnit(name);
        files.add(sourceUnit);
      }
    }
  }
 catch (  FatalDockerJSONException e) {
    throw new ServiceException("Error in listByContainerIdAndPath",e);
  }
  return files;
}

public List < SourceUnit > listLogsFilesByContainer ( String containerId ) throws ServiceException { List < SourceUnit > files = new ArrayList < > ( ) ; try { String logDirectory = getLogDirectory ( containerId ) ; if ( logDirectory . equalsIgnoreCase ( "stdout" ) ) { files . add ( new SourceUnit ( "stdout" ) ) ; return files ; } String containerName = dockerService . getContainerNameFromId ( containerId ) ; final String command = "find " + logDirectory + " -type f ! -size 0 " ; String execOutput = dockerService . execCommand ( containerName , command ) ; if ( execOutput != null && execOutput . contains ( "cannot access" ) == false ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( execOutput ) ; } StringTokenizer lignes = new StringTokenizer ( execOutput , "\n" ) ; while ( lignes . hasMoreTokens ( ) ) { String name = lignes . nextToken ( ) ; name = name . substring ( name . lastIndexOf ( "/" ) + 1 ) ; SourceUnit sourceUnit = new SourceUnit ( name ) ; files . add ( sourceUnit ) ; } } } catch ( FatalDockerJSONException e ) { throw new ServiceException ( "Error in listByContainerIdAndPath" , e ) ; } return files ; }
logs display feature < p > list the files into the log directory
