diff --git a/config/_default/menus/main.en.yaml b/config/_default/menus/main.en.yaml index 48f28f1688dea..051aeecd6d241 100644 --- a/config/_default/menus/main.en.yaml +++ b/config/_default/menus/main.en.yaml @@ -1107,6 +1107,11 @@ menu: parent: ide_plugins_idea identifier: ide_plugins_idea_debugger weight: 7012 + - name: Logs + url: developers/ide_plugins/idea/logs/ + parent: ide_plugins_idea + identifier: ide_plugins_idea_logs + weight: 7013 - name: VS Code & Cursor url: developers/ide_plugins/vscode/ parent: ide_plugins diff --git a/content/en/developers/ide_plugins/idea/_index.md b/content/en/developers/ide_plugins/idea/_index.md index d37b72f428b34..6e05187ddbfda 100644 --- a/content/en/developers/ide_plugins/idea/_index.md +++ b/content/en/developers/ide_plugins/idea/_index.md @@ -5,9 +5,12 @@ is_beta: true aliases: - '/developers/ide_integrations/idea/' further_reading: -- link: "/getting_started/profiler/" +- link: "/tracing/live_debugger/" tag: "Documentation" - text: "Getting started with Continuous Profiler." + text: "Learn about Live Debugger" +- link: "/logs/explorer/" + tag: "Documentation" + text: "Learn about Logs" - link: "/integrations/guide/source-code-integration/" tag: "Documentation" text: "Learn about Source Code Integration." @@ -27,16 +30,16 @@ further_reading: ## Overview -The Datadog plugin for JetBrains IDEs helps improve software performance by providing code insights in the IDE based on real-time observability data. The plugin is for developers that use Datadog products including [Log Explorer][5], [Error Tracking][6], [Live Debugger][21], [Continuous Profiler][10], [Code Security][7], [Test Optimization][18] and [CI Visibility][19] to monitor their services. It is available for IntelliJ IDEA, GoLand, PyCharm, WebStorm, and PhpStorm. +The Datadog plugin for JetBrains IDEs helps improve software performance by providing code insights in the IDE based on real-time observability data. The plugin is for developers that use Datadog products including [Error Tracking][6], [Live Debugger][21], [Logs][23], [Continuous Profiler][10], [Code Security][7], [Test Optimization][18] and [CI Visibility][19] to monitor their services. It is available for IntelliJ IDEA, GoLand, PyCharm, WebStorm, and PhpStorm. {{< img src="/developers/ide_plugins/idea/overview1.png" alt="The Datadog tool window open in IDEA" style="width:100%;" >}} -The **Logs** integration shows observed logs in the source code editor, and provides links to the [Log Explorer][5] to view logs generated by a specific line of code. - The **Code Insights** feature helps you find and fix runtime errors from [Error Tracking][6], library and runtime code vulnerabilities from [Code Security][7], flaky tests detected by [Test Optimization][18], and more. The [**Live Debugger**][20] enables you to capture vital debugging information by adding temporary logs to your runtime code and without having to stop and restart your service or application. +The [**Logs**][23] integration shows observed logs in the source code editor and provides links to the [Log Explorer][5] to view logs generated by a specific line of code. + The [**Continuous Profiler**][22] helps you to reduce latency and lower cloud costs by highlighting code that uses the most CPU time, allocates the most memory, triggers the most exceptions, or consumes high amounts of other resources. The **CI Test Runs** feature opens the [CI Visibility Explorer][9] to show recent runs for any test. @@ -83,17 +86,6 @@ To remove a service, select it in the **Services** table and click the minus ico
The names of linked services persist with the project when you close it.
-## Logs insights - -Log patterns from Datadog are matched directly to lines of code in your editor for your Java, JavaScript, TypeScript, Go, and Python source files: -{{< img src="/developers/ide_plugins/idea/log-patterns.png" alt="A log line showing log events from Datadog" style="width:100%;" >}} - -A popup shows runtime values from the log entries: -{{< img src="/developers/ide_plugins/idea/log-patterns-popup.png" alt="A popup showing log patterns from Datadog" style="width:100%;" >}} - -Click the log icon to open the [Log Explorer][5] in Datadog with a pre-filled query that matches the logger name, log level, and log message as closely as possible: -{{< img src="/developers/ide_plugins/idea/log-explorer-link.png" alt="A source file showing a View Logs icon and link." style="width:100%;" >}} - ## Code Insights The **Code Insights** tab displays insights generated by the Datadog platform that are relevant to your current project. The insights are grouped into three categories: performance, reliability, and security. @@ -111,7 +103,15 @@ The [**Live Debugger**][20] enables you to add logpoints—auto-expiring, non-br {{< img src="/developers/ide_plugins/idea/live_debugger/tool-window-tab.png" alt="The Live Debugger tab" style="width:100%;" >}} -Find out more in the [Live Debugger documentation][20]. +Find out more in the [Live Debugger][20] subsection. + +## Logs + +The [Logs][23] integration detects log lines in your source code, displays live event counts directly in the source editor, and provides links to the Datadog Log Explorer to view the logs generated by each log line. + +{{< img src="/developers/ide_plugins/idea/logs/logs.png" alt="Log events from Datadog" style="width:100%;" >}} + +Find out more in the [Logs][23] sub-section. ## Continuous Profiler @@ -119,7 +119,7 @@ The [**Continuous Profiler**][22] highlights resource consumption (such as CPU, {{< img src="/developers/ide_plugins/idea/continuous_profiler/flamegraph.png" alt="A flame graph showing CPU Time over the past hour" style="width:100%;" >}} -Find out more in the [Continuous Profiler documentation][22]. +Find out more in the [Continuous Profiler][22] sub-section. ## CI Test Runs You can view recent test runs in the [CI Visibility Explorer][12] by navigating directly from your source files. Look for the **CI Test Run** inlays above test method declarations in your source code: @@ -194,4 +194,5 @@ If you don't wish to send this data to Datadog, you can disable the collection a [19]: /continuous_integration/ [20]: /developers/ide_plugins/idea/live_debugger/ [21]: /tracing/live_debugger/ -[22]: /developers/ide_plugins/idea/continuous_profiler/ \ No newline at end of file +[22]: /developers/ide_plugins/idea/continuous_profiler/ +[23]: /developers/ide_plugins/idea/logs/ \ No newline at end of file diff --git a/content/en/developers/ide_plugins/idea/logs.md b/content/en/developers/ide_plugins/idea/logs.md new file mode 100644 index 0000000000000..ecfe035a89fa7 --- /dev/null +++ b/content/en/developers/ide_plugins/idea/logs.md @@ -0,0 +1,73 @@ +--- +title: Logs +type: documentation +further_reading: +- link: "/logs/explorer/" + tag: "Documentation" + text: "Learn more about Logs" +--- + +## Overview +The Logs integration detects log lines in your source code, displays live event counts directly in the source editor, and provides links to the Datadog [Log Explorer][16] to view the logs generated by each log line. + +{{< img src="/developers/ide_plugins/idea/logs/logs.png" alt="Logs in the source editor" style="width:100%;" >}} + +Hover over a log element to see matching log patterns with runtime value ranges. Use this runtime context to understand how your code behaves in production or other deployed environments. + +## Log queries +Click the log icon to query logs using Datadog: + +{{< img src="/developers/ide_plugins/idea/logs/log-query-button.png" alt="The log query button" style="width:80%;" >}} + +This launches the [Log Explorer][16] and shows the latest log events. The query is prefilled with the environment, log status, logger name, and text elements extracted from your source code: + +{{< img src="/developers/ide_plugins/idea/logs/browser.png" alt="The log query button" style="width:100%;" >}} + +Use the Datadog platform to inspect individual logs and related traces, or modify the search query to narrow down to the logs that you are most interested in. + +## Supported languages and frameworks +The Logs integration supports the following languages and logging frameworks: + +* **Java & Kotlin** : [SLF4J][1], [Log4j 2][2], [java.util.logging][3] and [Logback][17] +* **Go** : [Logrus][4], [Zap][5] and the [log package][6] in the Standard Library +* **Python** : [Python logging][7] and [Loguru][8] +* **JavaScript & TypeScript** : [Datadog Browser Logs][9] and [Winston][10] +* **PHP** : [Laravel][11], [Monolog][12], [Symfony][13] and [PSR-3][14] + +## Settings +Right-click a log element in the source editor to open the settings (Editor → Inlay Hints) for the current language, and to activate or deactivate the feature. + +### Logger name for Java and Kotlin +In Java and Kotlin, by convention, logs are normally tagged with the logger name corresponding to the fully qualified class name of the class where the logger is created. + +In rare cases, users post-process their logs data and modify the logger name tag to use only the simple class name. For these users, there is a **Logger name** setting to inform the plugin to create Log Explorer queries using the simple class name. + +{{< img src="/developers/ide_plugins/idea/logs/settings-java.png" alt="Log settings - Java" style="width:100%;" >}} + +## Advanced settings + +For a typical setup, the advanced settings are not required. However, if you have log events with a non-standard [logger name attribute][15], you can change the “Logger name tag” setting accordingly. If you set it to blank, the logger name will not be used in log queries at all. + +{{< img src="/developers/ide_plugins/idea/logs/settings-advanced.png" alt="Advanced settings" style="width:100%;" >}} + +## Further reading + +{{< partial name="whats-next/whats-next.html" >}} + +[1]: https://www.slf4j.org/ +[2]: https://logging.apache.org/log4j/2.12.x/index.html +[3]: https://docs.oracle.com/en/java/javase/25/docs/api/java.logging/java/util/logging/package-summary.html +[4]: https://github.com/sirupsen/logrus +[5]: https://github.com/uber-go/zap +[6]: https://pkg.go.dev/log +[7]: https://docs.python.org/3/library/logging.html +[8]: https://github.com/Delgan/loguru +[9]: https://docs.datadoghq.com/logs/log_collection/javascript/?tab=npm +[10]: https://github.com/winstonjs/winston +[11]: https://laravel.com/docs/12.x/logging +[12]: https://github.com/Seldaek/monolog +[13]: https://symfony.com/doc/current/logging.html +[14]: https://www.php-fig.org/psr/psr-3/ +[15]: https://docs.datadoghq.com/standard-attributes/?product=log +[16]: /logs/explorer/ +[17]: https://logback.qos.ch/ \ No newline at end of file diff --git a/static/images/developers/ide_plugins/idea/log-explorer-link.png b/static/images/developers/ide_plugins/idea/log-explorer-link.png deleted file mode 100644 index 391b786260d55..0000000000000 Binary files a/static/images/developers/ide_plugins/idea/log-explorer-link.png and /dev/null differ diff --git a/static/images/developers/ide_plugins/idea/log-patterns-popup.png b/static/images/developers/ide_plugins/idea/log-patterns-popup.png deleted file mode 100644 index 0329f89750c23..0000000000000 Binary files a/static/images/developers/ide_plugins/idea/log-patterns-popup.png and /dev/null differ diff --git a/static/images/developers/ide_plugins/idea/log-patterns.png b/static/images/developers/ide_plugins/idea/log-patterns.png deleted file mode 100644 index 5acb8a4f72272..0000000000000 Binary files a/static/images/developers/ide_plugins/idea/log-patterns.png and /dev/null differ diff --git a/static/images/developers/ide_plugins/idea/logs/browser.png b/static/images/developers/ide_plugins/idea/logs/browser.png new file mode 100644 index 0000000000000..6c6fc55d2eef3 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/logs/browser.png differ diff --git a/static/images/developers/ide_plugins/idea/logs/log-query-button.png b/static/images/developers/ide_plugins/idea/logs/log-query-button.png new file mode 100644 index 0000000000000..1bede7d10a9ea Binary files /dev/null and b/static/images/developers/ide_plugins/idea/logs/log-query-button.png differ diff --git a/static/images/developers/ide_plugins/idea/logs/logs.png b/static/images/developers/ide_plugins/idea/logs/logs.png new file mode 100644 index 0000000000000..a0269d3cba050 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/logs/logs.png differ diff --git a/static/images/developers/ide_plugins/idea/logs/settings-advanced.png b/static/images/developers/ide_plugins/idea/logs/settings-advanced.png new file mode 100644 index 0000000000000..b81259bdc2f4e Binary files /dev/null and b/static/images/developers/ide_plugins/idea/logs/settings-advanced.png differ diff --git a/static/images/developers/ide_plugins/idea/logs/settings-java.png b/static/images/developers/ide_plugins/idea/logs/settings-java.png new file mode 100644 index 0000000000000..f7378f9bd63d6 Binary files /dev/null and b/static/images/developers/ide_plugins/idea/logs/settings-java.png differ diff --git a/static/images/developers/ide_plugins/idea/overview1.png b/static/images/developers/ide_plugins/idea/overview1.png index 6bebbed32f95a..41cc30c130fc4 100644 Binary files a/static/images/developers/ide_plugins/idea/overview1.png and b/static/images/developers/ide_plugins/idea/overview1.png differ