Permalink
Browse files

Merge branch 'refactoring' of https://github.com/kencochrane/raven-java

… into refactoring
  • Loading branch information...
2 parents a2463df + 5bd9567 commit 82ee6e7a369f5a53e8afa92cfbd55968f34149cb @roam roam committed Jan 20, 2013
Showing with 73 additions and 19 deletions.
  1. +33 −17 README.md
  2. +38 −0 pom.xml
  3. +2 −2 raven/src/main/java/net/kencochrane/raven/Transport.java
View
@@ -5,7 +5,7 @@ Raven-Java is a Java client for [Sentry](https://www.getsentry.com/). Besides a
Raven-Java supports both HTTP(S) and UDP transport of messages.
## Sentry Versions Supported
-This client supports Sentry protocol version 2.0 (which is Sentry >= 2.0).
+This client supports Sentry protocol version 2.0 (which is Sentry >= 2.0).
Since version 4.6.0 of Sentry, signed messages have been deprecated. If you still use an earlier version, have a look at the client options below to find out how to enable signed messages.
@@ -26,14 +26,14 @@ public class Example {
Client = new Client(dsn);
client.captureMessage("Hello from Raven-Java!");
}
-
+
}
````
A full example is available in `raven/src/main/test/net/kencochrane/raven/ClientExample`.
-Note that `SentryDsn` will first examine the environment variables and system properties for a variable called `SENTRY_DSN`. If such a variable is available, *that* value will be used instead of the DSN you supply (the `rawDsn` variable in the example above).
+Note that `SentryDsn` will first examine the environment variables and system properties for a variable called `SENTRY_DSN`. If such a variable is available, *that* value will be used instead of the DSN you supply (the `rawDsn` variable in the example above).
This allows flexible usage of the library on PaaS providers such as Heroku. This also means the above example can be simplified to the following *if* you specify `SENTRY_DSN` in your:
@@ -51,7 +51,7 @@ public class Example {
Client = new Client();
client.captureMessage("Hello from Raven-Java!");
}
-
+
}
````
@@ -67,7 +67,7 @@ You can either utilize the `net.kencochrane.raven.log4j.SentryAppender` or `net.
Like the client, these appenders will examine the system properties and environment variables for a better `SENTRY_DSN` candidate. Which log messages are ultimately sent to your Sentry instance, depends on the configuration of your Sentry appender. If you only want to send error messages, use the following:
log4j.appender.sentry.Threshold=ERROR
-
+
### Asynchronous logging
If you use log4j's XML configuration, you can use its [AsyncAppender](http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/AsyncAppender.html) to wrap Raven-Java's `SentryAppender`.
@@ -79,26 +79,28 @@ But even if you use a properties file to configure log4j, you can log asynchrono
Client configuration is completely driven through the Sentry DSN. The DSN you can copy-paste from your Sentry instance looks like this:
http://public:private@host:port/1
-
+
Changing the behavior of the client is done through the *scheme* and *querystring* of the DSN.
-
+
### Transport protocols
-
+
#### HTTPS
If you're using https, your DSN should look like this:
https://public:private@host:port/1
-
+
#### Naive HTTPS
-If you're using https with a self-signed certificate and you're too lazy to add the certificate to your truststore, you can tell the client to be naive and allow it to ignore the certificate (which you really shouldn't do in a production environment):
+If you're using https with a wildcard certificate (which most Java versions can't handle) and you're too lazy
+to add the certificate to your truststore, you can tell the client to be naive and allow it to ignore the
+hostname verification:
naive+https://public:private@host:port/1
-
+
#### UDP
Prefer udp? Change your DSN to this:
udp://public:private@host:port/1
-
+
#### Asynchronous
The client can use a separate thread to actually send the messages to Sentry. To enable this feature, add `async+` to the scheme in your DSN:
@@ -109,7 +111,7 @@ The client can use a separate thread to actually send the messages to Sentry. To
async+naive+https://public:private@host:port/1
# Or
async+udp://public:private@host:port/1
-
+
#### Adding other schemes
You can add your own custom transport and scheme through the `register` method of the client.
@@ -122,12 +124,12 @@ More client configuration can be specified through the querystring of the DSN li
Signed messages have been deprecated in Sentry 4.6.0. If you're using an earlier version, you'll have to tell the client to sign messages through the option `raven.includeSignature`:
http://public:private@host:port/1?raven.includeSignature=true
-
+
#### HTTP/HTTPS timeout
The default timeout for HTTP/HTTPS transport is set to 10 seconds. If you want to change this value, use the `raven.timeout` option to specify the timeout in milliseconds.
http://public:private@host:port/1?raven.timeout=10000
-
+
#### Async queue configuration
When using the async transport (this is not the same as using the `AsyncSentryAppender`), you can configure the behavior of the underlying `java.util.concurrent.BlockingQueue` through the `raven.waitWhenFull` and `raven.capacity` options.
@@ -163,11 +165,25 @@ Then, add the following lines to web.xml:
* * *
## Installation
-TODO
-
+
+This version isn't available in the Central Maven repository yet. The easiest
+way to get started is to clone this repository and install the artifacts into
+your local repository or proxy like Nexus:
+
+ $ git clone https://github.com/kencochrane/raven-java.git
+ $ cd raven-java
+ $ mvn clean install
+
+This will build and test the Raven client and Log4J appender and install it
+into your local repository. You shouldn't worry about stacktraces appearing in
+the output unless tests are failing; they are *supposed* to be there.
+
* * *
## History
+
+- 2.0-SNAPSHOT
+ - Version increment to reduce confusion about releases
- 1.0
- Rewrite
- Support tags
View
38 pom.xml
@@ -10,6 +10,44 @@
<packaging>pom</packaging>
<name>raven-all</name>
<description>Java Raven client and loggers.</description>
+ <url>http://sentry.readthedocs.org/en/latest/client/index.html</url>
+
+ <licenses>
+ <license>
+ <name>BSD New</name>
+ <url>http://opensource.org/licenses/BSD-3-Clause</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <scm>
+ <url>git@github.com:kencochrane/raven-java.git</url>
+ <connection>scm:git:git://github.com/kencochrane/raven-java.git</connection>
+ <developerConnection>scm:git:git@github.com:kencochrane/raven-java.git</developerConnection>
+ </scm>
+
+ <developers>
+ <developer>
+ <id>kencochrane</id>
+ <name>Ken Cochrane</name>
+ <email>kencochrane+maven@gmail.com</email>
+ </developer>
+ <developer>
+ <id>roambe</id>
+ <name>Kevin Wetzels</name>
+ <email>kevin@roam.be</email>
+ </developer>
+ <developer>
+ <id>zeeg</id>
+ <name>David Cramer</name>
+ <email>contact@email.com</email>
+ </developer>
+ <developer>
+ <id>griphiam</id>
+ <name>Mark Philpot</name>
+ <email>contact@email.com</email>
+ </developer>
+ </developers>
<modules>
<module>raven</module>
@@ -230,8 +230,8 @@ protected HttpURLConnection getConnection() throws IOException {
}
/**
- * A naive HTTPS transport layer, useful in case you set up your own Sentry instance with self-signed
- * certificates and don't want to add the certificate to your truststore (you really should though).
+ * A naive HTTPS transport layer, useful in case you're using wildcard SSL certificates which
+ * Java doesn't handle that well.
*/
public static class NaiveHttps extends Http {

0 comments on commit 82ee6e7

Please sign in to comment.