-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b00ae91
Showing
7 changed files
with
962 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Tayler | ||
|
||
Tayler is a log tailing implementation forked from [Apache Commons IO](http://commons.apache.org/io/), providing improved performances, bug fixes and cleaner APIs. | ||
|
||
## Usage | ||
|
||
First, you need to implement the _tayler.TailerListener_ or _tayler.TailerListenerAdapter_, providing an implementation for the following API methods: | ||
|
||
* init: called on listener initialization. | ||
* handle: called at each line handling. | ||
* fileNotFound: called if the tailed file is not found. | ||
* fileRotated: called if the tailed file is rotated. | ||
* error: called in case of tail/handling errors. | ||
* stop: called after stopping tailer. | ||
|
||
Then, you just create a _tayler.Tailer_ object by specifying the following constructor arguments: | ||
|
||
* file: the log file to tail. | ||
* listener: the previously implemented listener. | ||
* delay: the tail delay time, in milliseconds. | ||
* end: a boolean specifying if tailing from start or end of file. | ||
* bufferSize: the size of the buffer for buffered reads, in bytes. | ||
|
||
The _tayler.Tailer_ object is indeed a Runnable, so the final step is to start a thread or submit it to an executor in order to actually start tailing. | ||
That's it. | ||
|
||
## Feedback | ||
|
||
Contact me on [twitter](http://twitter.com/sbtourist). | ||
|
||
## License | ||
|
||
Distributed under the [Apache Software License](http://www.apache.org/licenses/LICENSE-2.0.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>tayler</groupId> | ||
<artifactId>tayler</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>tayler</name> | ||
<url>https://github.com/sbtourist/tayler</url> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.0.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.