Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Jan 15, 2020
1 parent 8eaa9c3 commit 3f649d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 7 additions & 7 deletions docs/guide/src/docs/asciidoc/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,40 @@ repositories {
dependencies {
// load just simple implementation with POJO client and reflection based parser
testCompile "com.agorapulse:micronaut-log4aws:{version}"
implementation "com.agorapulse:micronaut-log4aws:{project-version}"
}
----

Also be sure that your build file **does not contain any referrence to Logback**:

.Build File Cleanup
[source,subs='verbatim,attributes']
```
----
dependencies {
// remove following line from your build file if present
runtime "ch.qos.logback:logback-classic:1.2.3"
}
```
----

Then remove Logback configuration file from `src/main/resources/logback.groovy`
and replace it with a new file `log4j2.xml` with following content. Feel free to update the file to fit your needs.


.Log4J2 Configuration
[source,xml,subs='verbatim,attributes']
```
----
include::../../../../../subprojects/micronaut-log4aws/src/test/resources/log4j2.xml[lines=1;21..51]
```
----

As a last step you need to create a file `sentry.properties` for sentry configuration - also in `src/main/resources`:

.sentry.properties
[source,properties,subs='verbatim,attributes']
```
----
# guarantees all events are logged before the function execution is finished
async=false
# you should consider adding your packages here to enable filtering of stack traces in Sentry
# stacktrace.app.packages=agorapulse,com.agorapulse
```
----
5 changes: 4 additions & 1 deletion docs/guide/src/docs/asciidoc/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Sentry logger is initialised automatically during the application startup. There is also `SentryClient` instance available for injection if you need to access lower level API.

All the errors have to be logged to be propagated to Sentry. You can use `LogErrors` around advice
around your method to simplify the logging boilerplate:
with your entry-point method to simplify the logging boilerplate:

.Using LogError Annotation
[source,java]
Expand All @@ -27,6 +27,7 @@ class ReportsExporter extends FunctionInitializer implements RequestHandler<SQSE
/**
* This class is handled by Micronaut and can use the advice.
*/
@Singleton
class ReportsService implements RequestHandler<SQSEvent, Void> {
@LogError
Expand All @@ -37,3 +38,5 @@ class ReportsService implements RequestHandler<SQSEvent, Void> {
}
----

WARNING: The annotation applied to the function class itself has no effect as the function class is executed by AWS Lambda container.

0 comments on commit 3f649d1

Please sign in to comment.