Skip to content

Commit

Permalink
First import.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbtourist committed Aug 29, 2011
0 parents commit b00ae91
Show file tree
Hide file tree
Showing 7 changed files with 962 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
33 changes: 33 additions & 0 deletions README.md
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).
44 changes: 44 additions & 0 deletions pom.xml
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>
Loading

0 comments on commit b00ae91

Please sign in to comment.