Skip to content

Conversation

@barchetta
Copy link
Member

Description

Documentation: Add SE logging guide.

See #9744

@barchetta barchetta requested a review from romain-grecourt May 20, 2025 18:17
@barchetta barchetta self-assigned this May 20, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 20, 2025
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there might be more text added to the page, but here is one minor typo.

@barchetta barchetta requested a review from tjquinno May 29, 2025 22:12
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are changes that should be made but I'll be out so I am not marking these as "requested" changes to avoid blocking progress on the PR!

== Helidon Logging

Helidon modules use the Java Platform Logging API (`System.Logger`) for logging. Therefore,
Helidon applications will use Java Util Logging (JUL) as the default log framework.
Copy link
Member

@ljnelson ljnelson Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it matters but Java calls the java.logging module, which houses the java.util.logging package, the Java Logging API.

== Customizing Logging with Java Util Logging

Since by default Helidon uses the Java Util Logging framework, you will see a
`logging.properties` file in most Helidon examples. It will be similar to this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the usage of logging.properties doesn't follow from the fact that the Java Logging API is used. Obviously people are somewhat familiar with the default logging.properties used by the JVM.


`HelidonConsoleHandler` is similar to the JUL `ConsoleHandler` with these additional capabilities:

1. Defaults the Handler log level to ALL so level filtering is performed only by the Logger
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handler -> Handler? ALL -> ALL? Logger -> Logger? Or just "logger"? Not sure what the convention you want is

`HelidonConsoleHandler` is similar to the JUL `ConsoleHandler` with these additional capabilities:

1. Defaults the Handler log level to ALL so level filtering is performed only by the Logger
2. Uses `HelidonFormatter` which is compatible with JUL `SimpleFormatter` and adds support for MDC tags and the `!thread!` keyword
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the first reference to MDC? If so maybe link to the section somehow


== log4j and slf4j support

If you wish to use another log framework, such has log4j or slf4j, and you wish to consolidate Helidon logging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"consolidate Helidon logging with" -> "route Helidon logs through"?


=== log4j

To use `log4j` with your Helidon application add the following dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…in runtime scope, yes?


=== slf4j

To use `slf4j` with your Helidon application add the following dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…in runtime scope, yes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x Version 4.x docs logging OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants