Skip to content

Commit 151f083

Browse files
joon-wonJoonWon Choireesscot
authored
Added Logging Dependency, Gradle Import Guide (#7479)
Co-authored-by: JoonWon Choi <[email protected]> Co-authored-by: Scott Rees <[email protected]>
1 parent bd4dccd commit 151f083

File tree

2 files changed

+31
-3
lines changed
  • src/pages/[platform]/build-a-backend/add-aws-services/logging

2 files changed

+31
-3
lines changed

src/pages/[platform]/build-a-backend/add-aws-services/logging/sdk/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The escape hatch provides access to the underlying `CloudWatchLogsClient` instan
2929

3030
**Gradle Imports**
3131

32-
```groovy
33-
implementation "aws.sdk.kotlin:cloudwatchlogs:KOTLIN_SDK_VERSION"
32+
```kotlin title="app/build.gradle.kts"
33+
implementation("aws.sdk.kotlin:cloudwatchlogs:KOTLIN_SDK_VERSION")
3434
```
3535

3636
<BlockSwitcher>

src/pages/[platform]/build-a-backend/add-aws-services/logging/set-up-logging/index.mdx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,39 @@ The Amplify Logger enables you to troubleshoot and debug issues with your apps,
3030

3131

3232

33-
* An Android application targeting at least Android SDK API level 24 with Amplify libraries integrated
33+
* An Android application targeting Android SDK API level 24 (Android 7.0) or above with Amplify libraries integrated
3434
* For a full example, please follow the [quickstart](/android/start/quickstart/).
3535
* The Amplify Logger is available for versions 2.11.0 and beyond of the Amplify Android SDK
3636

37+
### Install the Amplify library
3738

39+
Expand **Gradle Scripts**, open **build.gradle (Module: app)**. You will already have configured Amplify by following the steps in the [quickstart guide](/[platform]/start/quickstart/).
40+
41+
Add these libraries into the `dependencies` block:
42+
```kotlin title="app/build.gradle.kts"
43+
android {
44+
compileOptions {
45+
// Support for Java 8 features
46+
isCoreLibraryDesugaringEnabled = true
47+
sourceCompatibility = JavaVersion.VERSION_1_8
48+
targetCompatibility = JavaVersion.VERSION_1_8
49+
}
50+
}
51+
52+
dependencies {
53+
// Amplify API dependencies
54+
// highlight-start
55+
implementation("com.amplifyframework:aws-auth-cognito:ANDROID_VERSION")
56+
implementation("com.amplifyframework:aws-logging-cloudwatch:ANDROID_VERSION")
57+
// highlight-end
58+
// ... other dependencies
59+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
60+
}
61+
```
62+
63+
`aws-auth-cognito` is used to provide authentication for Amazon CloudWatch.
64+
65+
Click **Sync Now**.
3866

3967
</InlineFilter>
4068

0 commit comments

Comments
 (0)