Log Support

Compatible with: IntelliJ IDEA Android Studio
Dec 14, 2011
12 162
Log Support

This plugin supports creating and managing log calls.

Once installed the plugin makes using log frameworks as painless as printing to stdout.
This is achieved with the addition of intentions, live templates and code inspections that support the most important aspects of the configured log framework.
Whenever you'd attempt to write to stdout using "sout + TAB" you can now use "logd + TAB" to write a debug log line instead (other log levels are accessible via similarly named live templates).

The plugin is aware of loggers that are currently reachable from the context and can also add new loggers if none are reachable. Creating log output remains the same no matter what log framework is used as all operations inside the bundled live templates are performed using the framework that was previously defined for the current project scope. Log calls are validated and optionally wrapped in conditional expressions if this is desired.

On top of the basic feature set, enterprise class features like log ID and log review generation are available to help improving the overall quality of the generated log.


  • Supports possibly any log framework and facade
  • Pre-configured and tested with: log4j12, slf4j, java.util.logging and commons log
  • Assists in the generation of log IDs
  • Generates editable XHTML or ODS (Open Document Spreadsheet) review documents containing a collection of log messages that can be reviewed and adjusted by a non-developer (e.g. technical writer).
  • Adds 5 live templates logt, logd, logi, logw and loge that offer a framework neutral way of using log calls in the day to day business.
  • Adds 5 intentions and context actions that allow:
    • Wrapping and unwrapping log calls in 'if' conditions.
    • Add, update, replace or remove log IDs.
  • Adds 3 code inspections that verify whether:
    • Log calls are wrapped in 'if' conditions (depending on the project setup)
    • Formatted messages are valid when using MessageFormat or printf enabled frameworks.
    • Throwables can be combined with formatted messages (e.g. logback does not support this)

Full usage instructions can be found at the plugin's homepage.

Recent change notes

  • 1.0.11
    1. Fixed compatibility issues with IDEA >= 11.0
    2. Refactored the plugin to have 2 build targets: One for IDEA prior to 11 and one for 11 and later. (thanks to B.K. for opening the thread #5304686)
  • 1.0.10
    1. Fixed 3401836: Deadlock when generating log reviews and no matching log messages were found.
    2. Improvement: Added support for static log methods.
    3. Improvement: Added configurations for Android 'Log' and slf4j 'XLogger'.
  • 1.0.9
    1. Fixed 3396819: The cursor is not positioned correctly with braced conditions.
    2. Improvement: Showing a notification when no default log framework is set but required.
    3. Improvement 3305941: Shorten source names in log review.
    4. Improvement 3398563: Log reviews should maintain the order of logs as they appear.
  • 1.0.8
    1. Fixed 3308797: Log calls are not always detected correctly.
    2. Improvement: Throwables are optionally added when using any of the live templates and exceptions are in the scope (this used to be hardcoded in loge).
  • 1.0.7
    1. Fixed 3308351: Logging fails in IDEA 10.5 if multiple loggers exist.
    2. Fixed 3308322: Cannot enable the option "Do not use configured instances..".
  • 1.0.6
    1. Added initial support for JBoss logging.
  • 1.0.5
    1. Fixed 3306029: UI blocks if creating a log review and the rev. file exists.
  • 1.0.4
    1. Added 3305936: Support if condition that was stored in a variable.
    2. Fixed 3305978: Logger is not detected if the instance is a subclass.
    3. Fixed 3305945: Fails when surrounding class is interface.
    4. Fixed 3305942: No 'if' wrapping for newly added logger.
  • 1.0.3
    1. Added experimental support for log reviews in Open Document Spreadsheet (*.ods) format.
    2. Fixed code corruption bug in the recursive addition and removal of 'if' conditions.
    3. Fixed a couple of compatibility issues with IDEA >= 10.0.2
  • 1.0.2
    1. Fixed bugs in the action "Integrate Log Review".
    2. Added shortening of FQ names when logger field is added.
  • 1.0.1
    1. Fixed several minor bugs.
    2. Runs on IntelliJ IDEA 8 and 9 now.
    3. Released sources on SF.net.
  • 1.0
    1. Initial Release for IDEA >= 8.

General usage instructions

Check the features list. Once configured most features are available via live templates and intentions.