Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Commit 78a2502

Browse files
stopal-r7scawley-r7
authored andcommitted
initial commit
0 parents  commit 78a2502

33 files changed

+2890
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.directory
2+
/target
3+
.project
4+
.classpath
5+
.cache
6+
/.settings
7+
lib
8+
.idea
9+
*.iml
10+
release.properties
11+
*.db
12+
.DS_Store
13+
14+
# IDEA files
15+
atlassian-ide-plugin.xml

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: java
2+
jdk:
3+
- openjdk7
4+
- oraclejdk7
5+
- oraclejdk8
6+
before_install:
7+
# override default MAVEN_OPTS
8+
- echo "MAVEN_OPTS='-Xms1g -Xmx2g -XX:MaxPermSize=512m'" > ~/.mavenrc
9+
# Fix OpenJDK buffer overflow
10+
- cat /etc/hosts # optionally check the content *before*
11+
- sudo hostname "$(hostname | cut -c1-63)"
12+
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts > /tmp/hosts
13+
- sudo mv /tmp/hosts /etc/hosts
14+
- cat /etc/hosts # optionally check the content *after*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2013 Logentries
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[Please see our documentation page for usage information](https://insightops.help.rapid7.com/v1.0/docs/libraries)
2+
-------
3+
4+
Logging To InsightOps from Java
5+
==============================
6+
7+
Logentries currently supports logging from Java using the following logging libraries:
8+
9+
* [Log4J](https://insightops.help.rapid7.com/docs/log4j-log4j2)
10+
* [Log4J2](https://insightops.help.rapid7.com/docs/log4j-log4j2)
11+
* [Logback](https://insightops.help.rapid7.com/docs/logback)
12+
* [Java Util Logging](https://insightops.help.rapid7.com/docs/java-util-logging)
13+
14+
15+
-------
16+
17+
Maximum Log Length
18+
==================
19+
20+
Currently logs which exceed 65536 characters in length, including any patterns and timestamps you may include, will be split and sent as multiple logs.
21+
22+
-------
23+
24+
25+
Contact Support
26+
===============
27+
28+
Please email our support team at support@rapid7.com if you need any help.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
log4j.rootLogger=DEBUG,le
2+
log4j.appender.le=com.rapid7.log4j.LogentriesAppender
3+
log4j.appender.le.layout=org.apache.log4j.PatternLayout
4+
log4j.appender.le.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss ZZZ} %-5p: %F:%L %m
5+
log4j.appender.le.Token=LOGENTRIES_TOKEN
6+
log4j.appender.le.Region=eu
7+
log4j.appender.le.Debug=False
8+
log4j.appender.le.Ssl=False

configFiles/log4j.xml.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3+
<log4j:configuration debug="true">
4+
<appender name="le" class="com.rapid7.log4j.LogentriesAppender">
5+
<!-- Enter your Logentries token, like bc0c4f90-a2d6-11e1-b3dd-0800200c9a66 -->
6+
<param name="Token" value="LOGENTRIES_TOKEN" />
7+
<param name="Region" value="eu" />
8+
<param name="Debug" value="false" />
9+
<param name="Ssl" value="false" />
10+
<layout class="org.apache.log4j.PatternLayout">
11+
<param name="ConversionPattern"
12+
value="%d{yyyy-MM-dd HH:mm:ss ZZZ} %-5p (%F:%L) %m" />
13+
</layout>
14+
</appender>
15+
<logger name="example">
16+
<level value="debug" />
17+
</logger>
18+
<root>
19+
<priority value="debug"></priority>
20+
<appender-ref ref="le" />
21+
</root>
22+
</log4j:configuration>

configFiles/log4j2.xml.example

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Configuration status="WARN">
3+
<Appenders>
4+
<Logentries >
5+
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss ZZZ} %F.%L level:%-5p%m"/>
6+
<name>le</name>
7+
<token>LOGENTRIES_TOKEN</token>
8+
<region>eu</region>
9+
<debug>false</debug>
10+
<ignoreExceptions>false</ignoreExceptions>
11+
<logId></logId>
12+
<!-- datahub specific options -->
13+
<key>account_key</key>
14+
<useDataHub>false</useDataHub>
15+
<dataHubAddr>localhost</dataHubAddr>
16+
<location>my_datacentre</location>
17+
<dataHubPort>10000</dataHubPort>
18+
<logHostName>true</logHostName>
19+
<hostName>my_host</hostName>
20+
<httpPut>false</httpPut>
21+
</Logentries>
22+
</Appenders>
23+
24+
<Loggers>
25+
<Root level="DEBUG">
26+
<AppenderRef ref="le" />
27+
</Root>
28+
</Loggers>
29+
</Configuration>
30+
31+

configFiles/logback.xml.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<configuration>
3+
4+
<appender name="LE"
5+
class="com.rapid7.logback.LogentriesAppender">
6+
<Token>LOGENTRIES_TOKEN</Token>
7+
<Region>eu</Region>
8+
<Debug>False</Debug>
9+
<Ssl>False</Ssl>
10+
<facility>USER</facility>
11+
<encoder>
12+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
13+
</encoder>
14+
</appender>
15+
16+
<root level="debug">
17+
<appender-ref ref="LE" />
18+
</root>
19+
</configuration>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
handlers = com.rapid7.jul.LogentriesHandler
2+
.handlers = com.rapid7.jul.LogentriesHandler
3+
4+
com.rapid7.jul.LogentriesHandler.token = LOGENTRIES_TOKEN
5+
com.rapid7.jul.LogentriesHandler.region = eu
6+
com.rapid7.jul.LogentriesHandler.port = 10000
7+
com.rapid7.jul.LogentriesHandler.formatter = java.util.logging.SimpleFormatter

0 commit comments

Comments
 (0)