2.2 KiB
This page is Work in Progress - more information will be added over time.
{type="note"}
Logging
The IntelliJ platform uses Logger
abstraction class to shield from underlying logging implementation and configuration.
Plugins should obtain a dedicated instance:
import com.intellij.openapi.diagnostic.Logger;
public class MyPluginFunctionality {
private static final Logger LOG = Logger.getInstance(MyPluginFunctionality.class);
public void someMethod() {
LOG.info("someMethod() was called");
}
}
private val LOG = logger<MyPluginFunctionality>()
class MyPluginFunctionality {
fun someMethod() {
LOG.info("someMethod() was called")
}
}
If logging is used only to report exceptions, use convenience method thisLogger()
:
try {
// some code
}
catch (e: Throwable) {
thisLogger().error("some code failed", e)
}
By default, all messages with level INFO
and higher are written to log output file idea.log.
To enable DEBUG
/TRACE
logging for specific categories, use Help | Diagnostic Tools | Debug Log Settings.
When internal mode is enabled, the currently running IDE log file can be opened using Help | Open Log in Editor or located in filesystem via Help | Show Log in Finder/Explorer action.
To locate it for a specific installation, see this Knowledge Base article. See Development Instance Sandbox Directory on how to find it for development instances.
See Testing FAQ on how to enable DEBUG
/TRACE
level logging during tests, and obtain separate logs for failing tests.