The logback-extensions
module is an add-on for your logback context.
This module does the following things:
DefaultHttpGetAppender
: the DefaultHttpGetAppender can send some GET requests to an configured requestUrl if something is logged.HockeyAppCrashAppender
: the HockeyAppCrashAppender can send the stack trace of e.g. an exception of your program to hockeyapp, so hockey app can visualize your exception flows and create tickets in your bug tracker system automatically.
Current version is available at central repository
<dependencies>
...
<dependency>
<groupId>com.mikewinkelmann</groupId>
<artifactId>logback-extensions</artifactId>
<version>{CURRENT_VERSION}</version>
</dependency>
...
</dependencies>
First you must configure your appender in your logback.xml - see below. As a last resort you must add your configured appender to your root appender:
<root level="INFO">
<appender-ref ref="HTTPGETAPPENDER" />
<appender-ref ref="HOCKEYAPPCRASHAPPENDER" />
</root>
This appender sends some log file with the specific message to the hockey app crash backend.
Some properties are required some are optional
required properties are:
requestUrl
request url for the HTTP GET request
optional properties are:
loggingLevel
every log state you want to execute a GET call. Available states are the known: ERROR, WARN, INFO, DEBUG, TRACE you can also configure more than one log state with more loggingLevel tags - default: nothingsuccessStatusCodeMin
minimum successful http status code - default: 200successStatusCodeMax
maximum successful http status code - default: 299queueSize
size of the executing queue @TODO - default: 10
<appender name="HTTPGETAPPENDER" class="com.mikewinkelmann.logging.appender.http.DefaulthttpGetAppender">
<requestUrl>http://localhost:8080/testservice</requestUrl>
<loggingLevel>ERROR</loggingLevel>
<loggingLevel>WARN</loggingLevel>
<successStatusCodeMin>200</successStatusCodeMin>
<successStatusCodeMax>299</successStatusCodeMax>
<queueSize>10</queueSize>
</appender>
This appender sends some log file with the specific message to the hockey app crash backend.
Some properties are required some are optional
required properties are:
apiToken
your created apiToken on HockeyApp (Create: Profile/API Tokens)appId
your appId from HockeyApppackageName
the package name must match the bundle identifier set for the app on HockeyApp
optional properties are:
loggingLevel
every log state you want to execute a GET call. Available states are the known: ERROR, WARN, INFO, DEBUG, TRACE you can also configure more than one log state with more loggingLevel tags - default: nothingsuccessStatusCodeMin
minimum successful http status code - default: 200successStatusCodeMax
maximum successful http status code - default: 299queueSize
size of the executing reporting queue @TODO - default: 10userId
a string with a user, deviceId ..., limited to 255 chars - default: emptycontact
a string with contact information ..., limited to 255 chars - default: emptymodel
model of the device where this appender is running - default: emptymanufacturer
manufacturer of the device where this appender is running - default: emptyos
operating system of the device where this appender is running - default: emptyversion
version of the application where this appender is running in - default: empty
<appender name="HOCKEYAPPCRASHAPPENDER" class="com.mikewinkelmann.logging.appender.http.hockeyapp.HockeyAppCrashAppender">
<!-- ##### general config ##### -->
<loggingLevel>ERROR</loggingLevel>
<successStatusCodeMin>200</successStatusCodeMin>
<successStatusCodeMax>299</successStatusCodeMax>
<queueSize>10</queueSize>
<!-- ##### hockeyapp config ##### -->
<apiToken>123Abc456deF789Ghi0</apiToken>
<appId>1234567apId7654321</appId>
<packageName>your.package.name</packageName>
<userId>mwcom</userId>
<contact>[email protected]</contact>
<model>server1.mikewinkelmann.com</model>
<manufacturer>amazon-aws</manufacturer>
<os>cent os</os>
<version>specialwebservice1</version>
</appender>
- create CI plan
- switch to my new group id
- implement .addPart("attachment", this.createAttatchmentFile(event))