Log Support

Compatible with  IntelliJ IDEA
14.12.2011
13 850
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.

Features:

  • 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.

Download plugin

Version

Update date

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.
07.07.2016
@omega359 (and others) - It does look like this plug-in has been abandoned. I first reported the init error in mid March (https://sourceforge.net/p/logsupport/bugs/27/) and there has been no activity. I recently cloned the plug-in and started to fix the issue. I had a life interruption that required my focus for a bit and thus I have not had a chance to finish it yet. I see @pkuloki created a "Lite" version. I'm going to try and get my work finished soon and release a "full feature" forked version.
07.07.2016
I love this plugin, but it is not maintained. So I cloned the core features for SLF4J to a new plugin which is called "Log Support Lite".
25.06.2016
Is anyone going to take over this plugin? It's a very useful plugin that needs some TLC for 2016 && to clean up a few small bugs. Any takers?
24.06.2016
Is this plugin still maintained?
24.06.2016
When I install plugin on Intellij Idea 2016.1 no menu entry has appear in settings so I can't choose default framework etc.
10.06.2016
It seems the plugin does not work with the latest intellij anymore. At least not with version 2016.1.3 (Tested on windows). The Log support settings page is not displayed in the settings anymore so no default logging framework can be selected.
08.07.2014
Thanks! I love intensions and logd!
16.10.2012
The plugin works like a charm with SLF4J. Especially nice is that it properly checks that the the number of arguments matches the format string.
Please  sign in  to leave a comment.