Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document support for the Java platform logger #892

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/plugin/injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ The following objects are the same, no matter which plugin requests the injectio
The following types return an appropriate instance for the plugin:

- :javadoc:`PluginContainer` - returns the plugin container associated with the plugin it is being injected into
- ``org.apache.logging.log4j.Logger`` - returns the logger associated with the plugin it is being injected into
- ``org.apache.logging.log4j.Logger`` - returns the preferred logger associated with the plugin it is being injected into
- ``System.Logger`` - returns an alternate logger using the JDK facade, supported for integration with libraries which use it

Example: Injecting the Plugin Specific Logger and PluginContainer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 4 additions & 0 deletions source/plugin/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ There are a few logging frameworks available for use in Java. Logging is prefera

Sponge uses ``org.apache.logging.log4j.Logger``, not ``java.util.logging.Logger``.

Additionally, Sponge supports injection of a ``java.lang.System$Logger`` for better integration with libraries which use that framework.
While this abstraction is built into the JDK, it is also significantly more limited in functionality compared to the recommended
Log4J logger. As such, it is only useful for code that may run both within a Sponge environment, as well as on its own.

Getting a Logger
================

Expand Down