Skip to content

Commit

Permalink
Upgraded jerry-core:3.0.0 and removed redundant class
Browse files Browse the repository at this point in the history
  • Loading branch information
sangupta committed Jun 12, 2017
1 parent b17d5bf commit ff1a319
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 293 deletions.
71 changes: 35 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
Log-Parser
----------

[![Build Status](https://travis-ci.org/sangupta/log-parser.svg?branch=master)](https://travis-ci.org/sangupta/log-parser)
[![Coverage Status](https://coveralls.io/repos/github/sangupta/log-parser/badge.svg?branch=master)](https://coveralls.io/github/sangupta/log-parser?branch=master)
[![Travis](https://img.shields.io/travis/sangupta/log-parser.svg)]()
[![Coveralls](https://img.shields.io/coveralls/sangupta/log-parser.svg)]()
[![Maven Version](https://maven-badges.herokuapp.com/maven-central/com.sangupta/log-parser/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.sangupta/log-parser)
[![license](https://img.shields.io/github/license/sangupta/log-parser.svg)]()

A simple Java libary to parse various known log file formats into strongly-typed format-specific Java object. Once data is into a strongly typed object, its easier to run analysis on large files.
A simple Java libary to parse various known log file formats into strongly-typed
format-specific Java object. Once data is into a strongly typed object, its easier
to run analysis on large files.

Formats currently supported are:

Expand All @@ -16,7 +19,7 @@ Formats currently supported are:
* Adobe Experience Manager Replication logs
* Adobe Experience Manager Tar Optimization logs
* Sun/Oracle JDK GC logs
* Tomcat access logs (default format)
* Apache Tomcat access logs (default format)

### RoadMap

Expand All @@ -41,42 +44,38 @@ $ mvn clean package
You may include the library in your Maven project by adding the following to the `pom.xml`

```xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.sangupta</groupId>
<artifactId>log-parser</artifactId>
<version>-SNAPSHOT</version>
</dependency>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependency>
<groupId>com.github.sangupta</groupId>
<artifactId>log-parser</artifactId>
<version>-SNAPSHOT</version>
</dependency>
```

License
-------

```
/**
*
* log-parser: Parsers for various log formats
* Copyright (c) 2015-2016, Sandeep Gupta
*
* http://sangupta.com/projects/log-parser
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
log-parser: Parsers for various log formats
Copyright (c) 2015-2016, Sandeep Gupta
https://sangupta.com/projects/log-parser
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
<dependency>
<groupId>com.sangupta</groupId>
<artifactId>jerry-core</artifactId>
<version>2.4.0</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
<version>3.5</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.BufferedReader;
import java.io.IOException;

import com.sangupta.jerry.io.AdvancedStringReader;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.logparser.LogParser;
import com.sangupta.logparser.LogParserUtils;
import com.sangupta.logparser.common.StringTokenReader;

public class AEMAuditLogParser implements LogParser {

Expand All @@ -24,7 +24,7 @@ public AEMAuditLogLine parseLogLine(String logLine) {
}

AEMAuditLogLine line = new AEMAuditLogLine();
StringTokenReader reader = new StringTokenReader(logLine);
AdvancedStringReader reader = new AdvancedStringReader(logLine);
if(reader.hasNext()) {
line.timestamp = LogParserUtils.parseIntoTime(DATE_PATTERN, reader.readTillNext('['), -1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import java.io.BufferedReader;
import java.io.IOException;

import com.sangupta.jerry.io.AdvancedStringReader;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.jerry.util.StringUtils;
import com.sangupta.logparser.LogParser;
import com.sangupta.logparser.LogParserUtils;
import com.sangupta.logparser.common.StringTokenReader;

/**
* A {@link LogParser} implementation to parse <code>error.log</code>
Expand Down Expand Up @@ -123,7 +123,7 @@ public AEMErrorLogLine parseLogLine(String logLine) {
}

AEMErrorLogLine line = new AEMErrorLogLine();
StringTokenReader reader = new StringTokenReader(logLine);
AdvancedStringReader reader = new AdvancedStringReader(logLine);
if(reader.hasNext()) {
line.timestamp = LogParserUtils.parseIntoTime(DATE_TIME_PATTERN, reader.readTillNext('*'), -1);
}
Expand All @@ -137,7 +137,7 @@ public AEMErrorLogLine parseLogLine(String logLine) {
}

if(reader.hasNext()) {
splitMessageAndStackTrace(line, reader.getRemaining());
splitMessageAndStackTrace(line, reader.readRemaining());
}

return line;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.BufferedReader;
import java.io.IOException;

import com.sangupta.jerry.io.AdvancedStringReader;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.logparser.LogParser;
import com.sangupta.logparser.LogParserUtils;
import com.sangupta.logparser.common.StringTokenReader;

public class AEMReplicationLogParser implements LogParser {

Expand All @@ -24,7 +24,7 @@ public AEMReplicationLogLine parseLogLine(String logLine) {
}

AEMReplicationLogLine line = new AEMReplicationLogLine();
StringTokenReader reader = new StringTokenReader(logLine);
AdvancedStringReader reader = new AdvancedStringReader(logLine);
if(reader.hasNext()) {
String date = reader.readTillNext('*');
line.timestamp = LogParserUtils.parseIntoTime(DATE_PATTERN, date, -1);
Expand All @@ -42,7 +42,7 @@ public AEMReplicationLogLine parseLogLine(String logLine) {
line.clazz = reader.readTillNext(' ', 2).trim();
}

line.message = reader.getRemaining();
line.message = reader.readRemaining();
return line;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
import java.io.BufferedReader;
import java.io.IOException;

import com.sangupta.jerry.io.AdvancedStringReader;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.logparser.LogParser;
import com.sangupta.logparser.LogParserUtils;
import com.sangupta.logparser.common.HttpRequest;
import com.sangupta.logparser.common.HttpVerb;
import com.sangupta.logparser.common.StringTokenReader;

/**
* A {@link LogParser} that can be used to parse <code>request.log</code> files
Expand All @@ -54,7 +54,7 @@ public AEMRequestLogLine parseLogLine(String logLine) {
}

AEMRequestLogLine line = new AEMRequestLogLine();
StringTokenReader reader = new StringTokenReader(logLine);
AdvancedStringReader reader = new AdvancedStringReader(logLine);
if(reader.hasNext()) {
line.timestamp = LogParserUtils.parseIntoTime(DATE_TIME_PATTERN, reader.readTillNext('['), -1);
}
Expand Down Expand Up @@ -84,7 +84,7 @@ public AEMRequestLogLine parseLogLine(String logLine) {
}

if(reader.hasNext()) {
line.request.httpVersion = reader.getRemaining();
line.request.httpVersion = reader.readRemaining();
}
}

Expand All @@ -93,7 +93,7 @@ public AEMRequestLogLine parseLogLine(String logLine) {
line.statusCode = Integer.parseInt(reader.readTillNext(' '));
}

String remain = reader.getRemaining();
String remain = reader.readRemaining();
int space = remain.lastIndexOf(' ');
line.mime = remain.substring(0, space).trim();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.BufferedReader;
import java.io.IOException;

import com.sangupta.jerry.io.AdvancedStringReader;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.logparser.LogParser;
import com.sangupta.logparser.LogParserUtils;
import com.sangupta.logparser.common.StringTokenReader;

public class AEMTarOptimizationLogParser implements LogParser {

Expand All @@ -24,7 +24,7 @@ public AEMTarOptimizationLogLine parseLogLine(String logLine) {
}

AEMTarOptimizationLogLine line = new AEMTarOptimizationLogLine();
StringTokenReader reader = new StringTokenReader(logLine);
AdvancedStringReader reader = new AdvancedStringReader(logLine);
if(reader.hasNext()) {
String date = reader.readTillNext('*');
line.timestamp = LogParserUtils.parseIntoTime(DATE_PATTERN, date, -1);
Expand Down Expand Up @@ -64,7 +64,7 @@ public AEMTarOptimizationLogLine parseLogLine(String logLine) {

if(reader.hasNext()) {
reader.readTillNext("optimize:");
line.optimize = LogParserUtils.asLong(reader.getRemaining());
line.optimize = LogParserUtils.asLong(reader.readRemaining());
}

return line;
Expand Down
Loading

0 comments on commit ff1a319

Please sign in to comment.