:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
docs(logs): add android to logs onboarding (#60141)
Anna Garciab8d1ece6f02f
diff --git a/docs/onboarding/logs/android.tsx b/docs/onboarding/logs/android.tsxnew file mode 100644index 000000000000..34d32b429300--- /dev/null+++ b/docs/onboarding/logs/android.tsx@@ -0,0 +1,49 @@+import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/OnboardingDocsContentWrapper'++import { getAndroidSteps as getAndroidStepsPA } from '../product-analytics/android'+import { StepDefinition } from '../steps'++export const getAndroidSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {+ const { CodeBlock, Markdown, dedent } = ctx++ const installSteps = getAndroidStepsPA(ctx)++ const sendLogStep: StepDefinition = {+ title: 'Send a log',+ badge: 'required',+ content: (+ <>+ <Markdown>+ Capture a structured log record with `PostHog.logger`. Requires `com.posthog:posthog-android` 3.46.0+ or later. Records are batched and shipped to PostHog's logs product.+ </Markdown>+ <CodeBlock+ blocks={[+ {+ language: 'kotlin',+ file: 'Kotlin',+ code: dedent`+ import com.posthog.PostHog++ PostHog.logger.info("Server started", mapOf(+ "server.port" to 3000,+ "server.env" to "production"+ ))+ `,+ },+ ]}+ />+ <Markdown>+ {dedent`+ Logs appear in PostHog within a few seconds. Use the [Logs page](https://app.posthog.com/logs) to search and filter+ by service name, severity, or any attribute you attach.+ `}+ </Markdown>+ </>+ ),+ }++ return [...installSteps, sendLogStep]+}++export const AndroidInstallation = createInstallation(getAndroidSteps)diff --git a/docs/onboarding/logs/index.ts b/docs/onboarding/logs/index.tsindex 5ad1a14964d3..483e9d003be3 100644--- a/docs/onboarding/logs/index.ts+++ b/docs/onboarding/logs/index.ts@@ -1,3 +1,4 @@+export { AndroidInstallation } from './android'export { GoInstallation } from './go'export { IOSInstallation } from './ios'export { JavaInstallation } from './java'diff --git a/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsx b/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsxindex 5262478c3a7c..e02b9d091f04 100644--- a/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsx+++ b/frontend/src/scenes/onboarding/sdks/logs/LogsSDKInstructions.tsx@@ -1,4 +1,5 @@import {+ AndroidInstallation,GoInstallation,IOSInstallation,JavaInstallation,@@ -48,6 +49,10 @@ const LogsReactNativeInstructionsWrapper = withOnboardingDocsWrapper({Installation: ReactNativeInstallation,})+const LogsAndroidInstructionsWrapper = withOnboardingDocsWrapper({+ Installation: AndroidInstallation,+})+export const LogsSDKInstructions: SDKInstructionsMap = {[SDKKey.NODE_JS]: LogsNodeJSInstructionsWrapper,[SDKKey.NEXT_JS]: LogsNextJSInstructionsWrapper,@@ -57,4 +62,5 @@ export const LogsSDKInstructions: SDKInstructionsMap = {[SDKKey.OPENTELEMETRY]: LogsOpenTelemetryInstructionsWrapper,[SDKKey.IOS]: LogsIOSInstructionsWrapper,[SDKKey.REACT_NATIVE]: LogsReactNativeInstructionsWrapper,+ [SDKKey.ANDROID]: LogsAndroidInstructionsWrapper,}