Compare commits

...

3 Commits

5 changed files with 36 additions and 35 deletions

View File

@ -61,8 +61,6 @@ public final class Logar
*
* @param source
* the source
* @param target
* the target
*/
public static void anonymize(final File source)
{
@ -74,8 +72,8 @@ public final class Logar
*
* @param source
* the source
* @param target
* the target
* @param mapFile
* the map file
*/
public static void anonymize(final File source, final File mapFile)
{
@ -421,11 +419,12 @@ public final class Logar
}
/**
* Check sort for access files.
* Check sort file.
*
* @param source
* the source
* @param file
* the file
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void checkSortFile(final File file) throws IOException
{
@ -510,10 +509,10 @@ public final class Logar
}
/**
* Check concate on file.
* Test concate file.
*
* @param source
* the source
* @param file
* the file
*/
public static void testConcateFile(final File file)
{

View File

@ -108,8 +108,8 @@ public final class AnonMapFile
/**
* Save.
*
* @param source
* the source
* @param target
* the target
* @param map
* the map
*/

View File

@ -65,8 +65,6 @@ public final class Anonymizer
*
* @param source
* the source
* @param target
* the target
*/
public void anonymize(final File source)
{

View File

@ -184,12 +184,16 @@ public final class LogFile
}
/**
* Save access log.
* Save logs.
*
* @param source
* the source
* @throws IOException
* @param target
* the target
* @param logs
* the logs
* @throws FileNotFoundException
* the file not found exception
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void saveLogs(final File target, final Logs logs) throws FileNotFoundException, IOException
{
@ -217,11 +221,12 @@ public final class LogFile
}
/**
* Sort access log.
* Sort log file.
*
* @param target
* the target
* @param file
* the file
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void sortLogFile(final File file) throws IOException
{

View File

@ -55,13 +55,12 @@ public final class LogarCLI
message.appendln("Usage:");
message.appendln(" logar [ -h | -help | --help ]");
message.appendln(" logar [ -v | -version | --version ]");
message.appendln(" logar anonymize fileordirectory [mapfile] anonymize ip and user");
message.appendln(" logar archive source target archive previous month from /var/log/nginx/ tree");
message.appendln(" logar check fileordirectory check line format in log file");
message.appendln(" logar checksort fileordirectory check sort in log file");
message.appendln(" logar sort fileordirectory sort log files by datetime");
message.appendln(" logar testarchive source test archive without writing");
message.appendln(" logar testconcate fileordirectory test line concate in log file");
message.appendln(" logar anonymize fileordirectory [mapfile] anonymize ip and user");
message.appendln(" logar archive [-dry] source target archive previous month from /var/log/nginx/ tree");
message.appendln(" logar check fileordirectory check line format in log file");
message.appendln(" logar checksort fileordirectory check sort in log file");
message.appendln(" logar sort fileordirectory sort log files by datetime");
message.appendln(" logar testconcate fileordirectory test line concate in log file");
logger.info(message.toString());
}
@ -205,6 +204,13 @@ public final class LogarCLI
Logar.archive(source, target, DryOption.OFF);
}
else if (isMatching(args, "archive", "-dry", "\\s*\\S+\\s*", "\\s*\\S+\\s*"))
{
File source = new File(args[2]);
File target = new File(args[3]);
Logar.archive(source, target, DryOption.ON);
}
else if (isMatching(args, "check", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);
@ -223,13 +229,6 @@ public final class LogarCLI
Logar.sort(source);
}
else if (isMatching(args, "testarchive", "\\s*\\S+\\s*", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);
File target = new File(args[2]);
Logar.archive(source, target, DryOption.ON);
}
else if (isMatching(args, "testconcate", "\\s*\\S+\\s*"))
{
File source = new File(args[1]);