From 3f649d1a155856795011c3541d5e5bc061a5537c Mon Sep 17 00:00:00 2001 From: Vladimir Orany Date: Wed, 15 Jan 2020 15:35:10 +0100 Subject: [PATCH] docs --- docs/guide/src/docs/asciidoc/installation.adoc | 14 +++++++------- docs/guide/src/docs/asciidoc/usage.adoc | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/guide/src/docs/asciidoc/installation.adoc b/docs/guide/src/docs/asciidoc/installation.adoc index d5982c6..c21a4b1 100644 --- a/docs/guide/src/docs/asciidoc/installation.adoc +++ b/docs/guide/src/docs/asciidoc/installation.adoc @@ -13,7 +13,7 @@ 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}" } ---- @@ -21,12 +21,12 @@ 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. @@ -34,19 +34,19 @@ and replace it with a new file `log4j2.xml` with following content. Feel free to .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 -``` +---- diff --git a/docs/guide/src/docs/asciidoc/usage.adoc b/docs/guide/src/docs/asciidoc/usage.adoc index 3322437..5e72f19 100644 --- a/docs/guide/src/docs/asciidoc/usage.adoc +++ b/docs/guide/src/docs/asciidoc/usage.adoc @@ -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] @@ -27,6 +27,7 @@ class ReportsExporter extends FunctionInitializer implements RequestHandler { @LogError @@ -37,3 +38,5 @@ class ReportsService implements RequestHandler { } ---- +WARNING: The annotation applied to the function class itself has no effect as the function class is executed by AWS Lambda container. +