Diagnostic tools

Guicey provide many bundled console reports to help with problems diagnostic (or to simply clarify how application works) during development. All reports may be enabled on main guice bundle:

Detailed guicey configuration information
Prints available installers (helps understanding supported extensions)
Show yaml config introspection result (shows available yaml value bindings)
Guice bindings from registered modules
.printGuiceAopMap(GuiceAopConfig config)
AOP appliance map
Prints all registered resvlets and filters (including guice ServletModule declarations)
Prints all registered jersey extensions (exception mappers, filters etc.): including everything registered by dropwizard itself and all direct manual registrations.
Guicey lifecycle stages (separates logs to clearly see what messages relates to what phase)
In case of doubts about extension owner (guice or HK2) and suspicious for duplicate instantiation, you can enable strict control which will throw exception in case of wrong owner.

Diagnostic hook

It is obviously impossible to enable diagnostic reports without application re-compilation. But, sometimes, it is required to validate installed application. To workaround this situation, guicey provides special diagnostic hook, which can be enabled with a system property:


Hook activates the most commonly used reports:

public class DiagnosticHook implements GuiceyConfigurationHook {
    public void configure(final GuiceBundle.Builder builder) {


If provided hook doesn't cover all required reports, you can always make your own hook and register it's shortcut for simplified usage

Reports implementation

Report is implemented as guicey event listener. All sub-reports provide additional configuration options, so if default configuration (from shortcut methods above) does not fit your needs you can register listener directly with required configuration.

For example, available installers report is re-configured configuration report:

public Builder<T> printAvailableInstallers() {
    return listen(ConfigurationDiagnostic.builder("Available installers report")
            .printConfiguration(new DiagnosticConfig()
            .printContextTree(new ContextTreeConfig()

Report rendering logic may also be used directly as all reports (except lifecycle) provide separate renderer object implementing ReportRenderer. Renderers not bound to guice context and assume direct instantiation.

For examples of direct renderers usage see events implementation:

  • RunPhaseEvent.renderConfigurationBindings()
  • InjectorPhaseEvent.ReportRenderer


These shortcut methods allow easy render of report into string using received event object (in listener).